Browse Source

项目

master
zhanghaojie 5 years ago
parent
commit
21fd7187a1
100 changed files with 77026 additions and 0 deletions
  1. +1
    -0
      build.bat
  2. +1
    -0
      builde.bat
  3. +1
    -0
      buildp.bat
  4. +599
    -0
      easy_game/easy_ui/hall/HallUI.xml
  5. +133
    -0
      easy_game/easy_ui/hall/temp_game.xml
  6. +21
    -0
      easy_game/easy_ui/hall/temp_music.xml
  7. +105
    -0
      easy_game/easy_ui/hall/temp_rank.xml
  8. +56
    -0
      easy_game/easy_ui/load/LoadMian.xml
  9. +7
    -0
      easy_game/easy_ui/load/LoadView.xml
  10. +16
    -0
      easy_game/readme.txt
  11. +40
    -0
      easygame_project.xml
  12. +25
    -0
      egretProperties.json
  13. BIN
      favicon.ico
  14. +225
    -0
      index.html
  15. +15275
    -0
      libs/modules/egret/egret.d.ts
  16. +25098
    -0
      libs/modules/egret/egret.js
  17. +6
    -0
      libs/modules/egret/egret.min.js
  18. +7493
    -0
      libs/modules/egret/egret.native.js
  19. +3
    -0
      libs/modules/egret/egret.native.min.js
  20. +8666
    -0
      libs/modules/egret/egret.web.js
  21. +4
    -0
      libs/modules/egret/egret.web.min.js
  22. +2534
    -0
      libs/modules/game/game.d.ts
  23. +4744
    -0
      libs/modules/game/game.js
  24. +2
    -0
      libs/modules/game/game.min.js
  25. +186
    -0
      libs/modules/game/game.native.js
  26. +1
    -0
      libs/modules/game/game.native.min.js
  27. +253
    -0
      libs/modules/game/game.web.js
  28. +1
    -0
      libs/modules/game/game.web.min.js
  29. +1469
    -0
      libs/modules/res/res.d.ts
  30. +3515
    -0
      libs/modules/res/res.js
  31. +1
    -0
      libs/modules/res/res.min.js
  32. +1345
    -0
      libs/modules/tween/tween.d.ts
  33. +2076
    -0
      libs/modules/tween/tween.js
  34. +1
    -0
      libs/modules/tween/tween.min.js
  35. BIN
      resource/assets/loading/loading_bg.png
  36. BIN
      resource/assets/loading/loading_tiao.png
  37. BIN
      resource/assets/loading/loading_txt.png
  38. BIN
      resource/assets/loading/loading_view.png
  39. BIN
      resource/assets/loading/logo.png
  40. BIN
      resource/assets/sound/bg.mp3
  41. BIN
      resource/assets/sound/button.mp3
  42. BIN
      resource/assets/sound/dazhao.mp3
  43. BIN
      resource/assets/sound/gongji.mp3
  44. BIN
      resource/assets/sound/jieshu2.mp3
  45. BIN
      resource/assets/sound/shibai.mp3
  46. BIN
      resource/assets/sound/siwang1.mp3
  47. BIN
      resource/assets/ui/hall/1_10.png
  48. BIN
      resource/assets/ui/hall/1_8.png
  49. BIN
      resource/assets/ui/hall/1_9.png
  50. BIN
      resource/assets/ui/hall/4_1.png
  51. BIN
      resource/assets/ui/hall/4_14.png
  52. BIN
      resource/assets/ui/hall/4_5.png
  53. +47
    -0
      resource/assets/ui/hall/HallUI_200214184735.json
  54. BIN
      resource/assets/ui/hall/HallUI_200214184735.png
  55. +23
    -0
      resource/assets/ui/hall/HallUI_loader_200214184735.json
  56. BIN
      resource/assets/ui/hall/bg1.jpg
  57. BIN
      resource/assets/ui/hall/bg2.jpg
  58. BIN
      resource/assets/ui/hall/bg2_1.jpg
  59. BIN
      resource/assets/ui/hall/bg2_2.jpg
  60. BIN
      resource/assets/ui/hall/bg2_3.jpg
  61. BIN
      resource/assets/ui/hall/bg3.jpg
  62. +18
    -0
      resource/assets/ui/hall/temp_game_200214111114.json
  63. BIN
      resource/assets/ui/hall/temp_game_200214111114.png
  64. +9
    -0
      resource/assets/ui/hall/temp_game_loader_200214111114.json
  65. +8
    -0
      resource/assets/ui/hall/temp_music_200212133421.json
  66. BIN
      resource/assets/ui/hall/temp_music_200212133421.png
  67. +9
    -0
      resource/assets/ui/hall/temp_music_loader_200212133421.json
  68. +11
    -0
      resource/assets/ui/hall/temp_rank_200213114628.json
  69. BIN
      resource/assets/ui/hall/temp_rank_200213114628.png
  70. +9
    -0
      resource/assets/ui/hall/temp_rank_loader_200213114628.json
  71. BIN
      resource/assets/ui/hall/tishi1.png
  72. BIN
      resource/assets/ui/hall/tishi2.png
  73. BIN
      resource/assets/ui/hall/tishi3.png
  74. +8
    -0
      resource/assets/ui/load/LoadMian_200212144747.json
  75. BIN
      resource/assets/ui/load/LoadMian_200212144747.png
  76. BIN
      resource/assets/ui/load/loadbg.jpg
  77. +28
    -0
      resource/easygame_config.json
  78. +10
    -0
      resource/loading_main.json
  79. +11
    -0
      resource/loading_view.json
  80. +13
    -0
      resource/resource.json
  81. +137
    -0
      src/LoadingUI.ts
  82. +215
    -0
      src/Main.ts
  83. +146
    -0
      src/org/easygame/animate/AnimateData.ts
  84. +118
    -0
      src/org/easygame/animate/AnimateManager.ts
  85. +45
    -0
      src/org/easygame/animate/AnimateTexture.ts
  86. +194
    -0
      src/org/easygame/component/DebugWin.ts
  87. +57
    -0
      src/org/easygame/component/DefaultGuideWin.ts
  88. +77
    -0
      src/org/easygame/component/DefaultLoadingView.ts
  89. +131
    -0
      src/org/easygame/component/DefaultRenderer.ts
  90. +278
    -0
      src/org/easygame/component/LoadingBaseUI.ts
  91. +140
    -0
      src/org/easygame/component/MessageTips.ts
  92. +372
    -0
      src/org/easygame/component/ReceiveGroup.ts
  93. +44
    -0
      src/org/easygame/component/Template.ts
  94. +210
    -0
      src/org/easygame/component/View.ts
  95. +114
    -0
      src/org/easygame/component/Win.ts
  96. +55
    -0
      src/org/easygame/component/effect/BaseEffect.ts
  97. +31
    -0
      src/org/easygame/component/effect/IEffect.ts
  98. +33
    -0
      src/org/easygame/component/effect/RollerDown.ts
  99. +249
    -0
      src/org/easygame/core/GlobalSetting.ts
  100. +273
    -0
      src/org/easygame/core/HeartBeat.ts

+ 1
- 0
build.bat View File

@@ -0,0 +1 @@
egret build %cd%

+ 1
- 0
builde.bat View File

@@ -0,0 +1 @@
egret build %cd% -e

+ 1
- 0
buildp.bat View File

@@ -0,0 +1 @@
egret publish %cd%

+ 599
- 0
easy_game/easy_ui/hall/HallUI.xml View File

@@ -0,0 +1,599 @@
<ui>
<window name="HallUI" desc="" ui="view" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="bgColor" value="0xcc33" type="int16"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<window name="group1" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<window name="groupbut1" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<window name="imgbg1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\bg1.jpg" type="bitmapdata"/>
<property name="y" value="-172" type="number"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1506" type="number"/>
</window>
<window name="imgbut1_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_10.png" type="bitmapdata"/>
<property name="x" value="456" type="number"/>
<property name="y" value="484" type="number"/>
<property name="width" value="402" type="number"/>
<property name="height" value="559" type="number"/>
</window>
<window name="imgbut1_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_11.png" type="bitmapdata"/>
<property name="x" value="492" type="number"/>
<property name="y" value="888" type="number"/>
<property name="width" value="440" type="number"/>
<property name="height" value="319" type="number"/>
</window>
<window name="imgbut1_3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_8.png" type="bitmapdata"/>
<property name="x" value="-114" type="number"/>
<property name="y" value="589" type="number"/>
<property name="width" value="629" type="number"/>
<property name="height" value="678" type="number"/>
</window>
<window name="imgbut1_4" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_2.png" type="bitmapdata"/>
<property name="y" value="1172" type="number"/>
<property name="width" value="750" type="number"/>
<property name="height" value="371" type="number"/>
</window>
<window name="imgbut1_5" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_7.png" type="bitmapdata"/>
<property name="x" value="132" type="number"/>
<property name="y" value="1055" type="number"/>
<property name="width" value="486" type="number"/>
<property name="height" value="268" type="number"/>
</window>
</window>
<window name="imgtu1_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_9.png" type="bitmapdata"/>
<property name="x" value="-177" type="number"/>
<property name="y" value="-206" type="number"/>
<property name="width" value="573" type="number"/>
<property name="height" value="569" type="number"/>
</window>
<window name="groupal1" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="horizontalEnabled" value="true" type="boolean"/>
<property name="verticalEnabled" value="true" type="boolean"/>
<window name="imgall1_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_4.png" type="bitmapdata"/>
<property name="x" value="387" type="number"/>
<property name="y" value="125" type="number"/>
<property name="width" value="104" type="number"/>
<property name="height" value="136" type="number"/>
</window>
<window name="imgall1_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_5.png" type="bitmapdata"/>
<property name="x" value="634" type="number"/>
<property name="y" value="89" type="number"/>
<property name="width" value="106" type="number"/>
<property name="height" value="91" type="number"/>
</window>
<window name="imgall1_3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_6.png" type="bitmapdata"/>
<property name="x" value="475" type="number"/>
<property name="y" value="186" type="number"/>
<property name="width" value="254" type="number"/>
<property name="height" value="224" type="number"/>
</window>
<window name="imgall1_4" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_2.png" type="bitmapdata"/>
<property name="x" value="55" type="number"/>
<property name="y" value="301" type="number"/>
<property name="width" value="638" type="number"/>
<property name="height" value="266" type="number"/>
</window>
<window name="imgall1_5" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_3.png" type="bitmapdata"/>
<property name="x" value="211" type="number"/>
<property name="y" value="569" type="number"/>
<property name="width" value="326" type="number"/>
<property name="height" value="42" type="number"/>
</window>
</window>
</window>
<window name="group2" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<window name="imgbg2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\bg2.jpg" type="bitmapdata"/>
<property name="y" value="-172" type="number"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1506" type="number"/>
</window>
<window name="imgtu2_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\3_4.png" type="bitmapdata"/>
<property name="y" value="734" type="number"/>
<property name="width" value="303" type="number"/>
<property name="height" value="336" type="number"/>
</window>
<window name="imgtu2_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\3_8.png" type="bitmapdata"/>
<property name="x" value="170" type="number"/>
<property name="y" value="720" type="number"/>
<property name="width" value="88" type="number"/>
<property name="height" value="72" type="number"/>
</window>
<window name="groupall2" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="horizontalEnabled" value="true" type="boolean"/>
<window name="imgall2_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\3_1.png" type="bitmapdata"/>
<property name="x" value="199" type="number"/>
<property name="y" value="157" type="number"/>
<property name="width" value="354" type="number"/>
<property name="height" value="24" type="number"/>
</window>
<window name="imgall2_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\3_2.png" type="bitmapdata"/>
<property name="x" value="279" type="number"/>
<property name="y" value="227" type="number"/>
<property name="width" value="170" type="number"/>
<property name="height" value="36" type="number"/>
</window>
<window name="labelImg1" desc="" type="com.easyegret.ui.LabelImage" template="false">
<property name="text" value="666" type="string"/>
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\5_1.png" type="bitmapdata"/>
<property name="rollingZoomAlign" value="center" type="array_string"/>
<property name="width" value="200" type="number"/>
<property name="height" value="30" type="number"/>
<property name="x" value="377" type="number"/>
<property name="y" value="232" type="number"/>
<property name="showBg" value="false" type="boolean"/>
</window>
<window name="labelImg2" desc="" type="com.easyegret.ui.LabelImage" template="false">
<property name="text" value="66" type="string"/>
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\5_2.png" type="bitmapdata"/>
<property name="rollingZoomAlign" value="center" type="array_string"/>
<property name="width" value="300" type="number"/>
<property name="height" value="100" type="number"/>
<property name="x" value="225" type="number"/>
<property name="y" value="271" type="number"/>
<property name="showBg" value="false" type="boolean"/>
<property name="hAlign" value="center" type="array_string"/>
</window>
</window>
<window name="grouptemp" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
</window>
<window name="groupopen" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<property name="visible" value="false" type="boolean"/>
<window name="groupopenbg" desc="" type="com.easyegret.ui.Group" template="false">
<property name="bgColor" value="0xcce3fd" type="int16"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<property name="alpha" value="0.796875" type="number"/>
</window>
<window name="groupopenall" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="horizontalEnabled" value="true" type="boolean"/>
<property name="verticalEnabled" value="true" type="boolean"/>
<window name="imgopen1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_1.png" type="bitmapdata"/>
<property name="x" value="124.5" type="number"/>
<property name="y" value="227" type="number"/>
<property name="width" value="495" type="number"/>
<property name="height" value="298" type="number"/>
</window>
<window name="imgopen2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_6.png" type="bitmapdata"/>
<property name="x" value="199" type="number"/>
<property name="y" value="235" type="number"/>
<property name="width" value="342" type="number"/>
<property name="height" value="348" type="number"/>
</window>
</window>
</window>
<window name="imgbg3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
</window>
<window name="groupbut2" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="y" value="963" type="number"/>
<property name="width" value="750" type="number"/>
<property name="height" value="371" type="number"/>
<window name="imgbut2_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_2.png" type="bitmapdata"/>
<property name="width" value="750" type="number"/>
<property name="height" value="371" type="number"/>
</window>
<window name="imgbtn1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\btn1_1.png" type="bitmapdata"/>
<property name="x" value="18" type="number"/>
<property name="y" value="81" type="number"/>
<property name="width" value="185" type="number"/>
<property name="height" value="258" type="number"/>
</window>
<window name="imgbtn2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\btn2_1.png" type="bitmapdata"/>
<property name="x" value="211" type="number"/>
<property name="y" value="81" type="number"/>
<property name="width" value="185" type="number"/>
<property name="height" value="258" type="number"/>
</window>
<window name="imgbtn3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\btn3_1.png" type="bitmapdata"/>
<property name="x" value="405" type="number"/>
<property name="y" value="81" type="number"/>
<property name="width" value="185" type="number"/>
<property name="height" value="258" type="number"/>
</window>
<window name="imgbut2_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_4.png" type="bitmapdata"/>
<property name="x" value="606" type="number"/>
<property name="y" value="113" type="number"/>
<property name="width" value="106" type="number"/>
<property name="height" value="147" type="number"/>
</window>
<window name="imgbut2_3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_5.png" type="bitmapdata"/>
<property name="x" value="608" type="number"/>
<property name="y" value="272" type="number"/>
<property name="width" value="103" type="number"/>
<property name="height" value="33" type="number"/>
</window>
<window name="imgbut2_4" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_3.png" type="bitmapdata"/>
<property name="x" value="595" type="number"/>
<property name="y" value="100" type="number"/>
<property name="width" value="123" type="number"/>
<property name="height" value="200" type="number"/>
</window>
<window name="imgbut2_5" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_4.png" type="bitmapdata"/>
<property name="x" value="606" type="number"/>
<property name="y" value="113" type="number"/>
<property name="width" value="106" type="number"/>
<property name="height" value="147" type="number"/>
</window>
<window name="imgbut2_6" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\2_7.png" type="bitmapdata"/>
<property name="x" value="581" type="number"/>
<property name="y" value="83" type="number"/>
<property name="width" value="156" type="number"/>
<property name="height" value="231" type="number"/>
</window>
<window name="groupbtn4" desc="" type="com.easyegret.ui.Group" template="false">
<property name="border" value="false" type="boolean"/>
<property name="x" value="20" type="number"/>
<property name="y" value="80" type="number"/>
<property name="width" value="570" type="number"/>
<property name="height" value="250" type="number"/>
<property name="alpha" value="0" type="number"/>
</window>
<window name="grouptishi" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="x" value="-125" type="number"/>
<property name="y" value="-1329" type="number"/>
<property name="width" value="1000" type="number"/>
<property name="height" value="1700" type="number"/>
<window name="grouptsbg" desc="" type="com.easyegret.ui.Group" template="false">
<property name="bgColor" value="0x0" type="int16"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="1000" type="number"/>
<property name="height" value="1700" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<property name="alpha" value="0.5" type="number"/>
</window>
<window name="imgtishi1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\tishi1.png" type="bitmapdata"/>
<property name="x" value="341" type="number"/>
<property name="y" value="750" type="number"/>
<property name="width" value="418" type="number"/>
<property name="height" value="440" type="number"/>
</window>
<window name="imgtishi2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\tishi2.png" type="bitmapdata"/>
<property name="x" value="136" type="number"/>
<property name="y" value="1112" type="number"/>
<property name="width" value="584" type="number"/>
<property name="height" value="559" type="number"/>
</window>
<window name="imgtishi3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\tishi3.png" type="bitmapdata"/>
<property name="x" value="452" type="number"/>
<property name="y" value="1122" type="number"/>
<property name="width" value="403" type="number"/>
<property name="height" value="538" type="number"/>
</window>
</window>
<window name="grouptishi2" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="x" value="387" type="number"/>
<property name="y" value="-105" type="number"/>
<property name="width" value="353" type="number"/>
<property name="height" value="200" type="number"/>
<window name="imgtishi2_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\tishi4.png" type="bitmapdata"/>
<property name="width" value="353" type="number"/>
<property name="height" value="141" type="number"/>
</window>
<window name="imgtishi2_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\tishi5.png" type="bitmapdata"/>
<property name="x" value="250" type="number"/>
<property name="y" value="110" type="number"/>
<property name="width" value="63" type="number"/>
<property name="height" value="92" type="number"/>
</window>
</window>
</window>
</window>
<window name="group3" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<property name="visible" value="false" type="boolean"/>
<window name="imgover1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_1.png" type="bitmapdata"/>
<property name="autoSize" value="true" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
</window>
<window name="imgover2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_2.png" type="bitmapdata"/>
<property name="x" value="513" type="number"/>
<property name="y" value="20" type="number"/>
<property name="width" value="217" type="number"/>
<property name="height" value="316" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="top" value="20" type="number"/>
<property name="rightEnabled" value="true" type="boolean"/>
<property name="right" value="20" type="number"/>
</window>
<window name="groupover2" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="horizontalEnabled" value="true" type="boolean"/>
<property name="verticalEnabled" value="true" type="boolean"/>
<window name="groupover" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<window name="imgover3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_5.png" type="bitmapdata"/>
<property name="x" value="49" type="number"/>
<property name="y" value="362" type="number"/>
<property name="width" value="667" type="number"/>
<property name="height" value="566" type="number"/>
</window>
<window name="labelImg3" desc="" type="com.easyegret.ui.LabelImage" template="false">
<property name="text" value="666" type="string"/>
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\5_2.png" type="bitmapdata"/>
<property name="rollingZoomAlign" value="center" type="array_string"/>
<property name="width" value="500" type="number"/>
<property name="height" value="100" type="number"/>
<property name="x" value="125" type="number"/>
<property name="y" value="700" type="number"/>
<property name="showBg" value="false" type="boolean"/>
<property name="hAlign" value="center" type="array_string"/>
</window>
<window name="btnover1" desc="" type="com.easyegret.ui.Button" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_3.png" type="bitmapdata"/>
<property name="width" value="271" type="number"/>
<property name="height" value="139" type="number"/>
<property name="x" value="77" type="number"/>
<property name="y" value="989" type="number"/>
</window>
<window name="btnover2" desc="" type="com.easyegret.ui.Button" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_4.png" type="bitmapdata"/>
<property name="width" value="271" type="number"/>
<property name="height" value="139" type="number"/>
<property name="x" value="413" type="number"/>
<property name="y" value="989" type="number"/>
</window>
</window>
</window>
<window name="grouprank" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="horizontalEnabled" value="true" type="boolean"/>
<property name="verticalEnabled" value="true" type="boolean"/>
<property name="visible" value="false" type="boolean"/>
<window name="imgrank1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_14.png" type="bitmapdata"/>
<property name="x" value="41" type="number"/>
<property name="y" value="224" type="number"/>
<property name="width" value="672" type="number"/>
<property name="height" value="928" type="number"/>
</window>
<window name="imgrank2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="x" value="640" type="number"/>
<property name="y" value="209" type="number"/>
<property name="width" value="60" type="number"/>
<property name="height" value="60" type="number"/>
</window>
<window name="imgrank3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_7.png" type="bitmapdata"/>
<property name="x" value="679" type="number"/>
<property name="y" value="380" type="number"/>
<property name="width" value="21" type="number"/>
<property name="height" value="102" type="number"/>
</window>
<window name="grouptemp2" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="x" value="74" type="number"/>
<property name="y" value="361" type="number"/>
<property name="width" value="590" type="number"/>
<property name="height" value="616" type="number"/>
<window name="grouptemp3" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="590" type="number"/>
<property name="height" value="616" type="number"/>
</window>
</window>
<window name="imgrank4" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_9.png" type="bitmapdata"/>
<property name="autoSize" value="true" type="boolean"/>
<property name="x" value="76" type="number"/>
<property name="y" value="980" type="number"/>
<property name="width" value="580" type="number"/>
<property name="height" value="118" type="number"/>
</window>
<window name="btnclose" desc="" type="com.easyegret.ui.Button" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_6.png" type="bitmapdata"/>
<property name="width" value="60" type="number"/>
<property name="height" value="60" type="number"/>
<property name="x" value="640" type="number"/>
<property name="y" value="209" type="number"/>
</window>
<window name="temp_rank" desc="" path="hall/temp_rank.xml" type="CLASS" template="true">
<property name="x" value="74" type="number"/>
<property name="y" value="982" type="number"/>
<window name="group" desc="" type="com.easyegret.ui.Group" template="false">
<window name="imgra1_4" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_15.png" type="bitmapdata"/>
</window>
<window name="labelid" desc="" type="com.easyegret.ui.Label" template="false">
<property name="color" value="0xffffff" type="int16"/>
</window>
<window name="labelname" desc="" type="com.easyegret.ui.Label" template="false">
<property name="color" value="0xffffff" type="int16"/>
</window>
<window name="labelnum" desc="" type="com.easyegret.ui.Label" template="false">
<property name="color" value="0xffffff" type="int16"/>
</window>
</window>
</window>
</window>
</window>
<window name="temp_music" desc="" path="hall/temp_music.xml" type="CLASS" template="true">
<property name="x" value="650" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<window name="imgmusic" desc="" type="com.easyegret.ui.Image" template="false">
<property name="x" value="17" type="number"/>
<property name="y" value="19" type="number"/>
</window>
</window>
<window name="imglogo" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\1_1.png" type="bitmapdata"/>
<property name="x" value="31" type="number"/>
<property name="width" value="270" type="number"/>
<property name="height" value="94" type="number"/>
</window>
<window name="imglogo1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\logo1_1.png" type="bitmapdata"/>
<property name="x" value="30" type="number"/>
<property name="y" value="30" type="number"/>
<property name="width" value="189" type="number"/>
<property name="height" value="42" type="number"/>
<property name="visible" value="false" type="boolean"/>
</window>
<window name="imglogo1_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\logo1.png" type="bitmapdata"/>
<property name="x" value="380" type="number"/>
<property name="width" value="270" type="number"/>
<property name="height" value="96" type="number"/>
<property name="rightEnabled" value="true" type="boolean"/>
<property name="right" value="100" type="number"/>
<property name="visible" value="false" type="boolean"/>
</window>
<window name="imglogo3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\logo3.png" type="bitmapdata"/>
<property name="x" value="30" type="number"/>
<property name="width" value="274" type="number"/>
<property name="height" value="107" type="number"/>
<property name="visible" value="false" type="boolean"/>
</window>
</window>
<resources>
<res id="4_1" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\4_1.png</res>
<res id="bg1" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\bg1.jpg</res>
<res id="bg2" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\bg2.jpg</res>
<res id="bg2_1" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\bg2_1.jpg</res>
<res id="bg2_2" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\bg2_2.jpg</res>
<res id="bg2_3" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\bg2_3.jpg</res>
<res id="btn1_1">D:\办公\项目\UI\506_消灭病毒\切图\btn1_1.png</res>
<res id="btn1_2">D:\办公\项目\UI\506_消灭病毒\切图\btn1_2.png</res>
<res id="btn1_3">D:\办公\项目\UI\506_消灭病毒\切图\btn1_3.png</res>
<res id="btn2_1">D:\办公\项目\UI\506_消灭病毒\切图\btn2_1.png</res>
<res id="btn2_2">D:\办公\项目\UI\506_消灭病毒\切图\btn2_2.png</res>
<res id="btn2_3">D:\办公\项目\UI\506_消灭病毒\切图\btn2_3.png</res>
<res id="btn3_1">D:\办公\项目\UI\506_消灭病毒\切图\btn3_1.png</res>
<res id="btn3_2">D:\办公\项目\UI\506_消灭病毒\切图\btn3_2.png</res>
<res id="btn3_3">D:\办公\项目\UI\506_消灭病毒\切图\btn3_3.png</res>
<res id="1_8" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\1_8.png</res>
<res id="1_9" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\1_9.png</res>
<res id="1_10" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\1_10.png</res>
<res id="4_5" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\4_5.png</res>
<res id="4_14" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\4_14.png</res>
<res id="tishi1" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\tishi1.png</res>
<res id="tishi2" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\tishi2.png</res>
<res id="tishi3" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\tishi3.png</res>
</resources>
</ui>

+ 133
- 0
easy_game/easy_ui/hall/temp_game.xml View File

@@ -0,0 +1,133 @@
<ui>
<window name="temp_game" desc="" ui="template" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="174" type="number"/>
<property name="height" value="184" type="number"/>
<window name="group" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="174" type="number"/>
<property name="height" value="184" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<window name="imgtemp0_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\3_3.png" type="bitmapdata"/>
<property name="width" value="174" type="number"/>
<property name="height" value="184" type="number"/>
</window>
<window name="imgtemp0_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\3_3.png" type="bitmapdata"/>
<property name="x" value="174" type="number"/>
<property name="width" value="174" type="number"/>
<property name="height" value="184" type="number"/>
<property name="scaleX" value="-1" type="number"/>
</window>
<window name="imgtemp1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="autoSize" value="true" type="boolean"/>
<property name="x" value="47" type="number"/>
<property name="y" value="9" type="number"/>
<property name="width" value="20" type="number"/>
<property name="height" value="20" type="number"/>
</window>
<window name="imgtemp2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="autoSize" value="true" type="boolean"/>
<property name="x" value="77" type="number"/>
<property name="y" value="9" type="number"/>
<property name="width" value="20" type="number"/>
<property name="height" value="20" type="number"/>
</window>
<window name="imgtemp3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="autoSize" value="true" type="boolean"/>
<property name="x" value="107" type="number"/>
<property name="y" value="9" type="number"/>
<property name="width" value="20" type="number"/>
<property name="height" value="20" type="number"/>
</window>
<window name="grouptemp1" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="x" value="32" type="number"/>
<property name="y" value="9" type="number"/>
<property name="width" value="30" type="number"/>
<property name="height" value="30" type="number"/>
<window name="imgtemp1_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian1_3.png" type="bitmapdata"/>
<property name="width" value="30" type="number"/>
<property name="height" value="30" type="number"/>
</window>
<window name="imgtemp1_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian1_2.png" type="bitmapdata"/>
<property name="x" value="3" type="number"/>
<property name="y" value="3" type="number"/>
<property name="width" value="24" type="number"/>
<property name="height" value="24" type="number"/>
</window>
<window name="imgtemp1_3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian1_1.png" type="bitmapdata"/>
<property name="x" value="7" type="number"/>
<property name="y" value="7" type="number"/>
<property name="width" value="16" type="number"/>
<property name="height" value="16" type="number"/>
</window>
</window>
<window name="grouptemp2" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="x" value="72" type="number"/>
<property name="y" value="9" type="number"/>
<property name="width" value="30" type="number"/>
<property name="height" value="30" type="number"/>
<window name="imgtemp2_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian2_3.png" type="bitmapdata"/>
<property name="width" value="30" type="number"/>
<property name="height" value="30" type="number"/>
</window>
<window name="imgtemp2_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian2_2.png" type="bitmapdata"/>
<property name="x" value="3" type="number"/>
<property name="y" value="3" type="number"/>
<property name="width" value="24" type="number"/>
<property name="height" value="24" type="number"/>
</window>
<window name="imgtemp2_3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian2_1.png" type="bitmapdata"/>
<property name="x" value="7" type="number"/>
<property name="y" value="7" type="number"/>
<property name="width" value="16" type="number"/>
<property name="height" value="16" type="number"/>
</window>
</window>
<window name="grouptemp3" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="x" value="112" type="number"/>
<property name="y" value="9" type="number"/>
<property name="width" value="30" type="number"/>
<property name="height" value="30" type="number"/>
<window name="imgtemp3_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian3_3.png" type="bitmapdata"/>
<property name="width" value="30" type="number"/>
<property name="height" value="30" type="number"/>
</window>
<window name="imgtemp3_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian3_2.png" type="bitmapdata"/>
<property name="x" value="3" type="number"/>
<property name="y" value="3" type="number"/>
<property name="width" value="24" type="number"/>
<property name="height" value="24" type="number"/>
</window>
<window name="imgtemp3_3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\dian3_1.png" type="bitmapdata"/>
<property name="x" value="7" type="number"/>
<property name="y" value="7" type="number"/>
<property name="width" value="16" type="number"/>
<property name="height" value="16" type="number"/>
</window>
</window>
</window>
</window>
<resources/>
</ui>

+ 21
- 0
easy_game/easy_ui/hall/temp_music.xml View File

@@ -0,0 +1,21 @@
<ui>
<window name="temp_music" desc="" ui="template" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<window name="groupbtn" desc="" type="com.easyegret.ui.Group" template="false">
<property name="border" value="false" type="boolean"/>
<property name="alpha" value="0" type="number"/>
</window>
<window name="imgmusic" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\music1.png" type="bitmapdata"/>
<property name="x" value="29" type="number"/>
<property name="y" value="29" type="number"/>
<property name="width" value="42" type="number"/>
<property name="height" value="42" type="number"/>
</window>
</window>
<resources>
<res id="music1">D:\办公\项目\UI\506_消灭病毒\切图\music1.png</res>
<res id="music2">D:\办公\项目\UI\506_消灭病毒\切图\music2.png</res>
</resources>
</ui>

+ 105
- 0
easy_game/easy_ui/hall/temp_rank.xml View File

@@ -0,0 +1,105 @@
<ui>
<window name="temp_rank" desc="" ui="template" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="590" type="number"/>
<property name="height" value="118" type="number"/>
<window name="groupBTN" desc="" type="com.easyegret.ui.Group" template="false">
<property name="border" value="false" type="boolean"/>
<property name="width" value="590" type="number"/>
<property name="height" value="118" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<property name="alpha" value="0" type="number"/>
</window>
<window name="group" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="590" type="number"/>
<property name="height" value="118" type="number"/>
<window name="imgra1_0" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_13.png" type="bitmapdata"/>
<property name="x" value="13" type="number"/>
<property name="y" value="115" type="number"/>
<property name="width" value="564" type="number"/>
<property name="height" value="3" type="number"/>
</window>
<window name="imgra1_1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_10.png" type="bitmapdata"/>
<property name="x" value="2" type="number"/>
<property name="y" value="14" type="number"/>
<property name="width" value="554" type="number"/>
<property name="height" value="93" type="number"/>
</window>
<window name="imgra1_2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_11.png" type="bitmapdata"/>
<property name="x" value="8" type="number"/>
<property name="y" value="19" type="number"/>
<property name="width" value="536" type="number"/>
<property name="height" value="83" type="number"/>
</window>
<window name="imgra1_3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_12.png" type="bitmapdata"/>
<property name="x" value="13" type="number"/>
<property name="y" value="24" type="number"/>
<property name="width" value="512" type="number"/>
<property name="height" value="67" type="number"/>
</window>
<window name="imgra1_4" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_16.png" type="bitmapdata"/>
<property name="x" value="100" type="number"/>
<property name="y" value="24" type="number"/>
<property name="width" value="80" type="number"/>
<property name="height" value="81" type="number"/>
</window>
<window name="labelid" desc="" type="com.easyegret.ui.Label" template="false">
<property name="text" value="4" type="string"/>
<property name="fontSize" value="30" type="int"/>
<property name="autoSize" value="false" type="boolean"/>
<property name="height" value="50" type="number"/>
<property name="x" value="29" type="number"/>
<property name="y" value="36" type="number"/>
<property name="showBg" value="false" type="boolean"/>
</window>
<window name="imgicon" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_8.png" type="bitmapdata"/>
<property name="autoSize" value="true" type="boolean"/>
<property name="x" value="100" type="number"/>
<property name="y" value="19" type="number"/>
<property name="width" value="80" type="number"/>
<property name="height" value="80" type="number"/>
</window>
<window name="imgicon2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\4_8.png" type="bitmapdata"/>
<property name="x" value="100" type="number"/>
<property name="y" value="19" type="number"/>
<property name="width" value="80" type="number"/>
<property name="height" value="80" type="number"/>
</window>
<window name="labelname" desc="" type="com.easyegret.ui.Label" template="false">
<property name="text" value="MOMO" type="string"/>
<property name="fontSize" value="35" type="int"/>
<property name="autoSize" value="false" type="boolean"/>
<property name="width" value="200" type="number"/>
<property name="height" value="50" type="number"/>
<property name="x" value="200" type="number"/>
<property name="y" value="34" type="number"/>
<property name="showBg" value="false" type="boolean"/>
</window>
<window name="labelnum" desc="" type="com.easyegret.ui.Label" template="false">
<property name="text" value="BEST 666" type="string"/>
<property name="fontSize" value="33" type="int"/>
<property name="color" value="0x4456b0" type="int16"/>
<property name="autoSize" value="false" type="boolean"/>
<property name="width" value="200" type="number"/>
<property name="height" value="50" type="number"/>
<property name="x" value="429" type="number"/>
<property name="y" value="58" type="number"/>
<property name="showBg" value="false" type="boolean"/>
</window>
</window>
</window>
<resources/>
</ui>

+ 56
- 0
easy_game/easy_ui/load/LoadMian.xml View File

@@ -0,0 +1,56 @@
<ui>
<window name="LoadMian" desc="" ui="loadingmain" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="topEnabled" value="true" type="boolean"/>
<property name="bottomEnabled" value="true" type="boolean"/>
<property name="leftEnabled" value="true" type="boolean"/>
<property name="rightEnabled" value="true" type="boolean"/>
<window name="group" desc="" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
<property name="horizontalEnabled" value="true" type="boolean"/>
<property name="verticalEnabled" value="true" type="boolean"/>
<window name="imgbg" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\loadbg.jpg" type="bitmapdata"/>
<property name="width" value="750" type="number"/>
<property name="height" value="1334" type="number"/>
</window>
<window name="imgtu1" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\load1.png" type="bitmapdata"/>
<property name="x" value="276" type="number"/>
<property name="y" value="423" type="number"/>
<property name="width" value="198" type="number"/>
<property name="height" value="176" type="number"/>
</window>
<window name="imgtu2" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\load2.png" type="bitmapdata"/>
<property name="x" value="128" type="number"/>
<property name="y" value="554" type="number"/>
<property name="width" value="494" type="number"/>
<property name="height" value="82" type="number"/>
</window>
<window name="imgtu3" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\load3.png" type="bitmapdata"/>
<property name="x" value="156" type="number"/>
<property name="y" value="572" type="number"/>
<property name="width" value="438" type="number"/>
<property name="height" value="20" type="number"/>
</window>
<window name="imgtu4" desc="" type="com.easyegret.ui.Image" template="false">
<property name="texture" value="D:\办公\项目\UI\506_消灭病毒\切图\load3.png" type="bitmapdata"/>
<property name="x" value="156" type="number"/>
<property name="y" value="572" type="number"/>
<property name="width" value="438" type="number"/>
<property name="height" value="20" type="number"/>
</window>
</window>
</window>
<resources>
<res id="loadbg" merger="false">D:\办公\项目\UI\506_消灭病毒\切图\loadbg.jpg</res>
</resources>
</ui>

+ 7
- 0
easy_game/easy_ui/load/LoadView.xml View File

@@ -0,0 +1,7 @@
<ui>
<window name="LoadView" desc="" ui="loadingview" type="com.easyegret.ui.Group" template="false">
<property name="showBg" value="false" type="boolean"/>
<property name="border" value="false" type="boolean"/>
</window>
<resources/>
</ui>

+ 16
- 0
easy_game/readme.txt View File

@@ -0,0 +1,16 @@
easygame子目录文件使用说明:

easy_data :放置策划Excel数据表格的目录,用来生成项目的DataManager数据.数据生成请选择EasyGame工具的[数据生成]标签

easy_protocol :放置协议定义的目录,会根据xml定义的协议,生成对应的客户端协议和服务器端协议.协议生成请选择EasyGame工具的[数据生成]标签

easy_ui :放置工具生成的ui定义文件,这些ui定义文件会生成对应代码和材质.

easy_assets :放置美工的UI材质的目录,用户可以自定义自己习惯的目录
easy_scene :放置场景对应的数据
doc :该目录自由存放项目的其它文档


注意:导入的模块模板也会自动把数据解压到对应的目录,所以这些目录必须指定

+ 40
- 0
easygame_project.xml View File

@@ -0,0 +1,40 @@
<projects>
<name>506_virus</name>
<code_dir>D:\办公\项目\506_virus</code_dir>
<project_dir>D:\办公\项目\506_virus\easy_game\easy_ui</project_dir>
<easygame_dir>D:\办公\项目\506_virus\easy_game</easygame_dir>
<assets_dir>D:\办公\项目\UI\506_消灭病毒\切图</assets_dir>
<code_module>virus</code_module>
<compress_enable>true</compress_enable>
<compress_param></compress_param>
<framerate>60</framerate>
<data_gen_excel_dir>D:\办公\项目\506_virus\easy_game\easy_data</data_gen_excel_dir>
<data_gen_excel_setting>D:\办公\项目\506_virus\easy_game\easy_data\setting.xlsx</data_gen_excel_setting>
<data_gen_protocol_xml_dir>D:\办公\项目\506_virus\easy_game\easy_protocol</data_gen_protocol_xml_dir>
<data_gen_go_src_dir></data_gen_go_src_dir>
<data_gen_go_project_name></data_gen_go_project_name>
<data_gen_go_client_header>network.RequestHeader</data_gen_go_client_header>
<data_gen_go_server_header>network.ResultHeader</data_gen_go_server_header>
<data_gen_server_json_data_dir></data_gen_server_json_data_dir>
<publish_java_home></publish_java_home>
<publish_ant_home></publish_ant_home>
<publish_app_icon></publish_app_icon>
<publish_app_title></publish_app_title>
<publish_app_version_code>1</publish_app_version_code>
<publish_app_version_name>0.0.1</publish_app_version_name>
<publish_app_portrait>true</publish_app_portrait>
<publish_app_project_copy></publish_app_project_copy>
<publish_android_support></publish_android_support>
<publish_android_sdk></publish_android_sdk>
<publish_android_keystore></publish_android_keystore>
<publish_android_keystore_pwd></publish_android_keystore_pwd>
<publish_android_keystore_alias></publish_android_keystore_alias>
<publish_android_keystore_alias_pwd></publish_android_keystore_alias_pwd>
<guide_sence_width>600</guide_sence_width>
<guide_sence_height>800</guide_sence_height>
<is_res_random>true</is_res_random>
<rootDirRes>null</rootDirRes>
<publish_android_pkt_selected></publish_android_pkt_selected>
<publish_android_pkt_datas></publish_android_pkt_datas>
<resources/>
</projects>

+ 25
- 0
egretProperties.json View File

@@ -0,0 +1,25 @@
{
"native": {
"path_ignore": []
},
"publish": {
"web": 0,
"native": 1,
"path": "bin-release"
},
"egret_version": "3.2.6",
"modules": [
{
"name": "egret"
},
{
"name": "game"
},
{
"name": "tween"
},
{
"name": "res"
}
]
}

BIN
favicon.ico View File

Before After

+ 225
- 0
index.html View File

@@ -0,0 +1,225 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>506_virus</title>
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html, body {
-ms-touch-action: none;
background: #c5e3ee;
padding: 0;
border: 0;
margin: 0;
height: 100%;
}
</style>

<!--这个标签为通过egret提供的第三方库的方式生成的 javascript 文件。删除 modules_files 标签后,库文件加载列表将不会变化,请谨慎操作!-->
<!--modules_files_start-->
<script egret="lib" src="libs/modules/egret/egret.js" src-release="libs/modules/egret/egret.min.js"></script>
<script egret="lib" src="libs/modules/egret/egret.web.js" src-release="libs/modules/egret/egret.web.min.js"></script>
<script egret="lib" src="libs/modules/game/game.js" src-release="libs/modules/game/game.min.js"></script>
<script egret="lib" src="libs/modules/game/game.web.js" src-release="libs/modules/game/game.web.min.js"></script>
<script egret="lib" src="libs/modules/tween/tween.js" src-release="libs/modules/tween/tween.min.js"></script>
<script egret="lib" src="libs/modules/res/res.js" src-release="libs/modules/res/res.min.js"></script>
<!--modules_files_end-->

<!--这个标签为不通过egret提供的第三方库的方式使用的 javascript 文件,请将这些文件放在libs下,但不要放在modules下面。-->
<!--other_libs_files_start-->
<!--other_libs_files_end-->

<!--这个标签会被替换为项目中所有的 javascript 文件。删除 game_files 标签后,项目文件加载列表将不会变化,请谨慎操作!-->
<!--game_files_start-->
<script egret="game" src="bin-debug/org/easygame/ui/BaseGroup.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/Group.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/LoadingBaseUI.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/ReceiveGroup.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/Win.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/effect/BaseEffect.js"></script>
<script egret="game" src="bin-debug/org/easygame/core/GlobalSetting.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/View.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/control/ActorCtrl.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/display/Actor.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/MD5.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/Template.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/HGroup.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/DefaultLoadingView.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/animate/BaseAnimate.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/data/IActorData.js"></script>
<script egret="game" src="bin-debug/org/easygame/core/ObjectPool.js"></script>
<script egret="game" src="bin-debug/org/easygame/core/Version.js"></script>
<script egret="game" src="bin-debug/org/easygame/effect/EffectData.js"></script>
<script egret="game" src="bin-debug/org/easygame/effect/EffectUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/effect/TweenEffect.js"></script>
<script egret="game" src="bin-debug/org/easygame/event/EventManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/event/EventType.js"></script>
<script egret="game" src="bin-debug/org/easygame/event/MoreTouch.js"></script>
<script egret="game" src="bin-debug/org/easygame/event/MyEvent.js"></script>
<script egret="game" src="bin-debug/org/easygame/framework/EasyGame.js"></script>
<script egret="game" src="bin-debug/org/easygame/framework/PopupManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/framework/ResManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/framework/ViewManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/framework/msghandle/BaseHandle.js"></script>
<script egret="game" src="bin-debug/org/easygame/framework/msghandle/IHandle.js"></script>
<script egret="game" src="bin-debug/org/easygame/framework/msghandle/MessageControler.js"></script>
<script egret="game" src="bin-debug/org/easygame/guide/GuideChapter.js"></script>
<script egret="game" src="bin-debug/org/easygame/guide/GuideExecuteManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/guide/GuideItem.js"></script>
<script egret="game" src="bin-debug/org/easygame/guide/GuideManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/DirectionUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/RpgSetting.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/animate/AnimateManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/DefaultGuideWin.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/animate/EffectAnimate.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/animate/HitAnimate.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/animate/IAnimate.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/animate/ParalleQueue.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/animate/SequenceQueue.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/astar/AStar.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/astar/BinaryHeap.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/astar/Grid.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/astar/Link.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/astar/Node.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/MessageTips.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/control/NpcCtrl.js"></script>
<script egret="game" src="bin-debug/LoadingUI.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/data/ActorData.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/data/GameData.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/DebugWin.js"></script>
<script egret="game" src="bin-debug/org/easygame/animate/AnimateTexture.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/display/Camera.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/display/Map.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/display/Npc.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/display/Player.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/display/Scene.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/effect/IEffect.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/Button.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/effect/RollerDown.js"></script>
<script egret="game" src="bin-debug/org/easygame/component/DefaultRenderer.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/Image.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/Label.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/LabelImage.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/List.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/ListAd.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/MovieClip.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/ScrollGroup.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/Style.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/TextArea.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/TextInput.js"></script>
<script egret="game" src="bin-debug/org/easygame/ui/Video.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/DateUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/Debug.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/HexUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/HitTestUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/HttpUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/LocalStorage.js"></script>
<script egret="game" src="bin-debug/org/easygame/core/HeartBeat.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/MathUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/ObjectUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/ParabolaUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/ProgressCalculate.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/ShakeUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/Sound.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/SpriteUtils.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/StringUtil.js"></script>
<script egret="game" src="bin-debug/org/easygame/utils/UUID.js"></script>
<script egret="game" src="bin-debug/virus/loading/load/LoadMian.js"></script>
<script egret="game" src="bin-debug/virus/loading/load/LoadMianProgressMainBar.js"></script>
<script egret="game" src="bin-debug/virus/loading/load/LoadView.js"></script>
<script egret="game" src="bin-debug/virus/loading/load/LoadViewProgressViewBar.js"></script>
<script egret="game" src="bin-debug/virus/template/hall/temp_game.js"></script>
<script egret="game" src="bin-debug/virus/template/hall/temp_gameTemplate.js"></script>
<script egret="game" src="bin-debug/virus/template/hall/temp_music.js"></script>
<script egret="game" src="bin-debug/virus/template/hall/temp_musicTemplate.js"></script>
<script egret="game" src="bin-debug/virus/template/hall/temp_rank.js"></script>
<script egret="game" src="bin-debug/virus/template/hall/temp_rankTemplate.js"></script>
<script egret="game" src="bin-debug/virus/view/hall/GameData.js"></script>
<script egret="game" src="bin-debug/virus/view/hall/HallUI.js"></script>
<script egret="game" src="bin-debug/virus/view/hall/HallView.js"></script>
<script egret="game" src="bin-debug/org/easygame/animate/AnimateManager.js"></script>
<script egret="game" src="bin-debug/org/easygame/animate/AnimateData.js"></script>
<script egret="game" src="bin-debug/Main.js"></script>
<script egret="game" src="bin-debug/org/easygame/rpg/control/PlayerCtrl.js"></script>
<!--game_files_end-->
</head>
<body>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player"
data-entry-class="Main"
data-orientation="auto"
data-scale-mode="showAll"
data-frame-rate="30"
data-content-width="750"
data-content-height="1334"
data-show-paint-rect="false"
data-multi-fingered="2"
data-show-fps="false" data-show-log="false"
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div>
<audio id="music1"><source src="resource/assets/sound/bg.mp3" type="audio/mpeg"></audio>
<audio id="gongji"><source src="resource/assets/sound/gongji.mp3" type="audio/mpeg"></audio>
<audio id="shibai"><source src="resource/assets/sound/shibai.mp3" type="audio/mpeg"></audio>
<audio id="siwang1"><source src="resource/assets/sound/siwang1.mp3" type="audio/mpeg"></audio>
<audio id="dazhao"><source src="resource/assets/sound/dazhao.mp3" type="audio/mpeg"></audio>
<audio id="jieshu"><source src="resource/assets/sound/jieshu2.mp3" type="audio/mpeg"></audio>
<script>
var kaiguan=false;
var music1=document.getElementById("music1");
music1.loop=true;
var _audioArrar = ["gongji","shibai","siwang1","dazhao","jieshu"];
document.addEventListener("DOMContentLoaded",function(){
document.addEventListener("WeixinJSBridgeReady",function(){
music1.play();
for(var i= 0;i<_audioArrar.length;i++){
new audioPlay2(_audioArrar[i]);
}
},false);
});
var musicstart=true;
function audioPaly() {
musicstart=true;
music1.muted=false;
music1.volume=1;
music1.play();
}
function audioPause() {
musicstart=false;
music1.muted=true;
music1.volume=0;
music1.pause();
}
function audioPlay2(audioid){
var audio = document.getElementById(audioid);
audio.muted=true;
audio.volume=0;
audio.play();
audio.addEventListener("playing",pause1);
}
function pause1(e){
e.currentTarget.pause();
e.currentTarget.removeEventListener("playing",pause1);
}
function audioPlay3(audioid){
var audio = document.getElementById(audioid);
audio.muted=false;
audio.volume=1;
audio.currentTime = 0;
audio.play();
}
/**
* {
* "renderMode":, //引擎渲染模式,"canvas" 或者 "webgl"
* "audioType": "" //使用的音频类型,0:默认,1:qq audio,2:web audio,3:audio
* "antialias": //WebGL模式下是否开启抗锯齿,true:开启,false:关闭,默认为false
* }
**/
egret.sys.screenAdapter = new easy.EasyGameFullScreen();
egret.runEgret({renderMode:"canvas", audioType:0});
</script>
</body>
</html>

+ 15275
- 0
libs/modules/egret/egret.d.ts
File diff suppressed because it is too large
View File


+ 25098
- 0
libs/modules/egret/egret.js
File diff suppressed because it is too large
View File


+ 6
- 0
libs/modules/egret/egret.min.js
File diff suppressed because it is too large
View File


+ 7493
- 0
libs/modules/egret/egret.native.js
File diff suppressed because it is too large
View File


+ 3
- 0
libs/modules/egret/egret.native.min.js
File diff suppressed because it is too large
View File


+ 8666
- 0
libs/modules/egret/egret.web.js
File diff suppressed because it is too large
View File


+ 4
- 0
libs/modules/egret/egret.web.min.js
File diff suppressed because it is too large
View File


+ 2534
- 0
libs/modules/game/game.d.ts
File diff suppressed because it is too large
View File


+ 4744
- 0
libs/modules/game/game.js
File diff suppressed because it is too large
View File


+ 2
- 0
libs/modules/game/game.min.js
File diff suppressed because it is too large
View File


+ 186
- 0
libs/modules/game/game.native.js View File

@@ -0,0 +1,186 @@
var __reflect = (this && this.__reflect) || function (p, c, t) {
p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
//////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014-present, Egret Technology.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Egret nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////////////
var egret;
(function (egret) {
var native;
(function (native) {
/**
* @private
*/
var NativeNetContext = (function (_super) {
__extends(NativeNetContext, _super);
function NativeNetContext() {
var _this = _super.call(this) || this;
_this.urlData = {};
return _this;
}
/**
* @method egret.HTML5NetContext#proceed
* @param loader {URLLoader}
*/
NativeNetContext.prototype.proceed = function (loader) {
var self = this;
if (loader.dataFormat == egret.URLLoaderDataFormat.TEXTURE) {
self.loadTexture(loader);
return;
}
if (loader.dataFormat == egret.URLLoaderDataFormat.SOUND) {
self.loadSound(loader);
return;
}
var request = loader._request;
var virtualUrl = self.getVirtualUrl(egret.$getUrl(request));
var httpRequest = new egret.HttpRequest();
httpRequest.open(virtualUrl, request.method == egret.URLRequestMethod.POST ? egret.HttpMethod.POST : egret.HttpMethod.GET);
var length = request.requestHeaders.length;
for (var i = 0; i < length; i++) {
var urlRequestHeader = request.requestHeaders[i];
httpRequest.setRequestHeader(urlRequestHeader.name, urlRequestHeader.value);
}
httpRequest.addEventListener(egret.Event.COMPLETE, function () {
loader.data = httpRequest.response;
egret.Event.dispatchEvent(loader, egret.Event.COMPLETE);
}, this);
httpRequest.addEventListener(egret.IOErrorEvent.IO_ERROR, function () {
egret.IOErrorEvent.dispatchIOErrorEvent(loader);
}, this);
httpRequest.responseType = loader.dataFormat == egret.URLLoaderDataFormat.BINARY ? egret.HttpResponseType.ARRAY_BUFFER : egret.HttpResponseType.TEXT;
httpRequest.send(request.data);
};
NativeNetContext.prototype.loadSound = function (loader) {
var self = this;
var virtualUrl = this.getVirtualUrl(loader._request.url);
var sound = new egret.Sound();
sound.addEventListener(egret.Event.COMPLETE, onLoadComplete, self);
sound.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
sound.addEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
sound.load(virtualUrl);
function onPostProgress(event) {
loader.dispatchEvent(event);
}
function onError(event) {
removeListeners();
loader.dispatchEvent(event);
}
function onLoadComplete(e) {
removeListeners();
loader.data = sound;
var loadedFunc = function () {
loader.dispatchEventWith(egret.Event.COMPLETE);
};
if (__global.setTimeout) {
__global.setTimeout(loadedFunc, 0);
}
else {
egret.$callAsync(loadedFunc, self);
}
}
function removeListeners() {
sound.removeEventListener(egret.Event.COMPLETE, onLoadComplete, self);
sound.removeEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
sound.removeEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
}
};
NativeNetContext.prototype.loadTexture = function (loader) {
var self = this;
var request = loader._request;
var virtualUrl = self.getVirtualUrl(request.url);
var imageLoader = new egret.ImageLoader();
imageLoader.addEventListener(egret.Event.COMPLETE, onLoadComplete, self);
imageLoader.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
imageLoader.addEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
imageLoader.load(virtualUrl);
function onPostProgress(event) {
loader.dispatchEvent(event);
}
function onError(event) {
removeListeners();
loader.dispatchEvent(event);
}
function onLoadComplete(e) {
removeListeners();
var bitmapData = imageLoader.data;
//bitmapData.setAttribute("bitmapSrc", virtualUrl);
var texture = new egret.Texture();
texture._setBitmapData(bitmapData);
loader.data = texture;
var loadedFunc = function () {
loader.dispatchEventWith(egret.Event.COMPLETE);
};
if (__global.setTimeout) {
__global.setTimeout(loadedFunc, 0);
}
else {
egret.$callAsync(loadedFunc, self);
}
}
function removeListeners() {
imageLoader.removeEventListener(egret.Event.COMPLETE, onLoadComplete, self);
imageLoader.removeEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
imageLoader.removeEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
}
};
/**
* 是否是网络地址
* @param url
* @returns {boolean}
*/
NativeNetContext.prototype.isNetUrl = function (url) {
return url.indexOf("http://") != -1 || url.indexOf("HTTP://") != -1 || url.indexOf("https://") != -1 || url.indexOf("HTTPS://") != -1;
};
/**
* 获取虚拟url
* @param url
* @returns {string}
*/
NativeNetContext.prototype.getVirtualUrl = function (url) {
return url;
};
NativeNetContext.getNetContext = function () {
if (NativeNetContext._instance == null) {
NativeNetContext._instance = new NativeNetContext();
}
return NativeNetContext._instance;
};
return NativeNetContext;
}(egret.HashObject));
NativeNetContext.__use_asyn = egret_native.readFileAsync == null ? false : true;
native.NativeNetContext = NativeNetContext;
__reflect(NativeNetContext.prototype, "egret.native.NativeNetContext", ["egret.NetContext"]);
egret.NetContext = NativeNetContext;
})(native = egret.native || (egret.native = {}));
})(egret || (egret = {}));

+ 1
- 0
libs/modules/game/game.native.min.js View File

@@ -0,0 +1 @@
var __reflect=this&&this.__reflect||function(t,e,n){t.__class__=e,n?n.push(e):n=[e],t.__types__=t.__types__?n.concat(t.__types__):n},__extends=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},egret;!function(t){var e;!function(e){var n=function(e){function n(){var t=e.call(this)||this;return t.urlData={},t}return __extends(n,e),n.prototype.proceed=function(e){var n=this;if(e.dataFormat==t.URLLoaderDataFormat.TEXTURE)return void n.loadTexture(e);if(e.dataFormat==t.URLLoaderDataFormat.SOUND)return void n.loadSound(e);var r=e._request,o=n.getVirtualUrl(t.$getUrl(r)),a=new t.HttpRequest;a.open(o,r.method==t.URLRequestMethod.POST?t.HttpMethod.POST:t.HttpMethod.GET);for(var i=r.requestHeaders.length,s=0;i>s;s++){var E=r.requestHeaders[s];a.setRequestHeader(E.name,E.value)}a.addEventListener(t.Event.COMPLETE,function(){e.data=a.response,t.Event.dispatchEvent(e,t.Event.COMPLETE)},this),a.addEventListener(t.IOErrorEvent.IO_ERROR,function(){t.IOErrorEvent.dispatchIOErrorEvent(e)},this),a.responseType=e.dataFormat==t.URLLoaderDataFormat.BINARY?t.HttpResponseType.ARRAY_BUFFER:t.HttpResponseType.TEXT,a.send(r.data)},n.prototype.loadSound=function(e){function n(t){e.dispatchEvent(t)}function r(t){a(),e.dispatchEvent(t)}function o(n){a(),e.data=E;var r=function(){e.dispatchEventWith(t.Event.COMPLETE)};__global.setTimeout?__global.setTimeout(r,0):t.$callAsync(r,i)}function a(){E.removeEventListener(t.Event.COMPLETE,o,i),E.removeEventListener(t.IOErrorEvent.IO_ERROR,r,i),E.removeEventListener(t.ProgressEvent.PROGRESS,n,i)}var i=this,s=this.getVirtualUrl(e._request.url),E=new t.Sound;E.addEventListener(t.Event.COMPLETE,o,i),E.addEventListener(t.IOErrorEvent.IO_ERROR,r,i),E.addEventListener(t.ProgressEvent.PROGRESS,n,i),E.load(s)},n.prototype.loadTexture=function(e){function n(t){e.dispatchEvent(t)}function r(t){a(),e.dispatchEvent(t)}function o(n){a();var r=v.data,o=new t.Texture;o._setBitmapData(r),e.data=o;var s=function(){e.dispatchEventWith(t.Event.COMPLETE)};__global.setTimeout?__global.setTimeout(s,0):t.$callAsync(s,i)}function a(){v.removeEventListener(t.Event.COMPLETE,o,i),v.removeEventListener(t.IOErrorEvent.IO_ERROR,r,i),v.removeEventListener(t.ProgressEvent.PROGRESS,n,i)}var i=this,s=e._request,E=i.getVirtualUrl(s.url),v=new t.ImageLoader;v.addEventListener(t.Event.COMPLETE,o,i),v.addEventListener(t.IOErrorEvent.IO_ERROR,r,i),v.addEventListener(t.ProgressEvent.PROGRESS,n,i),v.load(E)},n.prototype.isNetUrl=function(t){return-1!=t.indexOf("http://")||-1!=t.indexOf("HTTP://")||-1!=t.indexOf("https://")||-1!=t.indexOf("HTTPS://")},n.prototype.getVirtualUrl=function(t){return t},n.getNetContext=function(){return null==n._instance&&(n._instance=new n),n._instance},n}(t.HashObject);n.__use_asyn=null==egret_native.readFileAsync?!1:!0,e.NativeNetContext=n,__reflect(n.prototype,"egret.native.NativeNetContext",["egret.NetContext"]),t.NetContext=n}(e=t["native"]||(t["native"]={}))}(egret||(egret={}));

+ 253
- 0
libs/modules/game/game.web.js View File

@@ -0,0 +1,253 @@
var __reflect = (this && this.__reflect) || function (p, c, t) {
p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
//////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014-present, Egret Technology.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Egret nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////////////////
var egret;
(function (egret) {
var web;
(function (web) {
/**
* @class egret.HTML5NetContext
* @classdesc
* @extends egret.NetContext
* @private
*/
var HTML5NetContext = (function (_super) {
__extends(HTML5NetContext, _super);
/**
* @private
*/
function HTML5NetContext() {
return _super.call(this) || this;
}
/**
* @private
*
* @param loader
*/
HTML5NetContext.prototype.proceed = function (loader) {
var self = this;
if (loader.dataFormat == egret.URLLoaderDataFormat.TEXTURE) {
this.loadTexture(loader);
return;
}
if (loader.dataFormat == egret.URLLoaderDataFormat.SOUND) {
this.loadSound(loader);
return;
}
var request = loader._request;
var virtualUrl = self.getVirtualUrl(egret.$getUrl(request));
var httpLoader = new egret.HttpRequest();
httpLoader.addEventListener(egret.Event.COMPLETE, onLoadComplete, this);
httpLoader.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, this);
httpLoader.addEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, this);
httpLoader.open(virtualUrl, request.method);
httpLoader.responseType = this.getResponseType(loader.dataFormat);
if (request.method == egret.URLRequestMethod.GET || !request.data) {
httpLoader.send();
}
else if (request.data instanceof egret.URLVariables) {
httpLoader.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
var urlVars = request.data;
httpLoader.send(urlVars.toString());
}
else {
httpLoader.setRequestHeader("Content-Type", "multipart/form-data");
httpLoader.send(request.data);
}
/*function onReadyStateChange() {
if (xhr.readyState == 4) {// 4 = "loaded"
if (xhr.status != loader._status) {
loader._status = xhr.status;
HTTPStatusEvent.dispatchHTTPStatusEvent(loader, xhr.status);
}
if (xhr.status >= 400 || xhr.status == 0) {//请求错误
IOErrorEvent.dispatchIOErrorEvent(loader);
}
else {
onLoadComplete();
}
}
}*/
function onPostProgress(event) {
loader.dispatchEvent(event);
}
function onError(event) {
removeListeners();
loader.dispatchEvent(event);
}
function onLoadComplete() {
removeListeners();
switch (loader.dataFormat) {
case egret.URLLoaderDataFormat.VARIABLES:
loader.data = new egret.URLVariables(httpLoader.response);
break;
//case URLLoaderDataFormat.TEXT:
// loader.data = httpLoader.response;
// break;
//case URLLoaderDataFormat.BINARY:
// loader.data = httpLoader.response;
// break;
default:
loader.data = httpLoader.response;
break;
}
window.setTimeout(function () {
egret.Event.dispatchEvent(loader, egret.Event.COMPLETE);
}, 0);
}
function removeListeners() {
httpLoader.removeEventListener(egret.Event.COMPLETE, onLoadComplete, self);
httpLoader.removeEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
httpLoader.removeEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
}
};
/**
* @private
*
* @param dataFormat
*/
HTML5NetContext.prototype.getResponseType = function (dataFormat) {
switch (dataFormat) {
case egret.URLLoaderDataFormat.TEXT:
case egret.URLLoaderDataFormat.VARIABLES:
return egret.URLLoaderDataFormat.TEXT;
case egret.URLLoaderDataFormat.BINARY:
return "arraybuffer";
default:
return dataFormat;
}
};
/**
* @private
*
* @param loader
*/
HTML5NetContext.prototype.loadSound = function (loader) {
var self = this;
var virtualUrl = this.getVirtualUrl(loader._request.url);
var sound = new egret.Sound();
sound.addEventListener(egret.Event.COMPLETE, onLoadComplete, self);
sound.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
sound.addEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
sound.load(virtualUrl);
function onPostProgress(event) {
loader.dispatchEvent(event);
}
function onError(event) {
removeListeners();
loader.dispatchEvent(event);
}
function onLoadComplete(e) {
removeListeners();
loader.data = sound;
window.setTimeout(function () {
loader.dispatchEventWith(egret.Event.COMPLETE);
}, 0);
}
function removeListeners() {
sound.removeEventListener(egret.Event.COMPLETE, onLoadComplete, self);
sound.removeEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
sound.removeEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
}
};
/**
* @private
*
* @param loader
*/
HTML5NetContext.prototype.loadTexture = function (loader) {
var self = this;
var virtualUrl = this.getVirtualUrl(loader._request.url);
var imageLoader = new egret.ImageLoader();
imageLoader.addEventListener(egret.Event.COMPLETE, onLoadComplete, self);
imageLoader.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
imageLoader.addEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
imageLoader.load(virtualUrl);
function onPostProgress(event) {
loader.dispatchEvent(event);
}
function onError(event) {
removeListeners();
loader.dispatchEvent(event);
}
function onLoadComplete(e) {
removeListeners();
var bitmapData = imageLoader.data;
bitmapData.source.setAttribute("bitmapSrc", virtualUrl);
var texture = new egret.Texture();
texture._setBitmapData(bitmapData);
loader.data = texture;
window.setTimeout(function () {
loader.dispatchEventWith(egret.Event.COMPLETE);
}, self);
}
function removeListeners() {
imageLoader.removeEventListener(egret.Event.COMPLETE, onLoadComplete, self);
imageLoader.removeEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);
imageLoader.removeEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);
}
};
/**
* @private
*
* @returns
*/
HTML5NetContext.prototype.getChangeList = function () {
return [];
};
/**
* @private
* 获取虚拟url
* @param url
* @returns {string}
*/
HTML5NetContext.prototype.getVirtualUrl = function (url) {
return url;
};
HTML5NetContext.getNetContext = function () {
if (HTML5NetContext._instance == null) {
HTML5NetContext._instance = new HTML5NetContext();
}
return HTML5NetContext._instance;
};
return HTML5NetContext;
}(egret.HashObject));
web.HTML5NetContext = HTML5NetContext;
__reflect(HTML5NetContext.prototype, "egret.web.HTML5NetContext", ["egret.NetContext"]);
egret.NetContext = HTML5NetContext;
})(web = egret.web || (egret.web = {}));
})(egret || (egret = {}));

+ 1
- 0
libs/modules/game/game.web.min.js View File

@@ -0,0 +1 @@
var __reflect=this&&this.__reflect||function(t,e,n){t.__class__=e,n?n.push(e):n=[e],t.__types__=t.__types__?n.concat(t.__types__):n},__extends=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},egret;!function(t){var e;!function(e){var n=function(e){function n(){return e.call(this)||this}return __extends(n,e),n.prototype.proceed=function(e){function n(t){e.dispatchEvent(t)}function r(t){a(),e.dispatchEvent(t)}function o(){switch(a(),e.dataFormat){case t.URLLoaderDataFormat.VARIABLES:e.data=new t.URLVariables(d.response);break;default:e.data=d.response}window.setTimeout(function(){t.Event.dispatchEvent(e,t.Event.COMPLETE)},0)}function a(){d.removeEventListener(t.Event.COMPLETE,o,s),d.removeEventListener(t.IOErrorEvent.IO_ERROR,r,s),d.removeEventListener(t.ProgressEvent.PROGRESS,n,s)}var s=this;if(e.dataFormat==t.URLLoaderDataFormat.TEXTURE)return void this.loadTexture(e);if(e.dataFormat==t.URLLoaderDataFormat.SOUND)return void this.loadSound(e);var i=e._request,E=s.getVirtualUrl(t.$getUrl(i)),d=new t.HttpRequest;if(d.addEventListener(t.Event.COMPLETE,o,this),d.addEventListener(t.IOErrorEvent.IO_ERROR,r,this),d.addEventListener(t.ProgressEvent.PROGRESS,n,this),d.open(E,i.method),d.responseType=this.getResponseType(e.dataFormat),i.method!=t.URLRequestMethod.GET&&i.data)if(i.data instanceof t.URLVariables){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var u=i.data;d.send(u.toString())}else d.setRequestHeader("Content-Type","multipart/form-data"),d.send(i.data);else d.send()},n.prototype.getResponseType=function(e){switch(e){case t.URLLoaderDataFormat.TEXT:case t.URLLoaderDataFormat.VARIABLES:return t.URLLoaderDataFormat.TEXT;case t.URLLoaderDataFormat.BINARY:return"arraybuffer";default:return e}},n.prototype.loadSound=function(e){function n(t){e.dispatchEvent(t)}function r(t){a(),e.dispatchEvent(t)}function o(n){a(),e.data=E,window.setTimeout(function(){e.dispatchEventWith(t.Event.COMPLETE)},0)}function a(){E.removeEventListener(t.Event.COMPLETE,o,s),E.removeEventListener(t.IOErrorEvent.IO_ERROR,r,s),E.removeEventListener(t.ProgressEvent.PROGRESS,n,s)}var s=this,i=this.getVirtualUrl(e._request.url),E=new t.Sound;E.addEventListener(t.Event.COMPLETE,o,s),E.addEventListener(t.IOErrorEvent.IO_ERROR,r,s),E.addEventListener(t.ProgressEvent.PROGRESS,n,s),E.load(i)},n.prototype.loadTexture=function(e){function n(t){e.dispatchEvent(t)}function r(t){a(),e.dispatchEvent(t)}function o(n){a();var r=E.data;r.source.setAttribute("bitmapSrc",i);var o=new t.Texture;o._setBitmapData(r),e.data=o,window.setTimeout(function(){e.dispatchEventWith(t.Event.COMPLETE)},s)}function a(){E.removeEventListener(t.Event.COMPLETE,o,s),E.removeEventListener(t.IOErrorEvent.IO_ERROR,r,s),E.removeEventListener(t.ProgressEvent.PROGRESS,n,s)}var s=this,i=this.getVirtualUrl(e._request.url),E=new t.ImageLoader;E.addEventListener(t.Event.COMPLETE,o,s),E.addEventListener(t.IOErrorEvent.IO_ERROR,r,s),E.addEventListener(t.ProgressEvent.PROGRESS,n,s),E.load(i)},n.prototype.getChangeList=function(){return[]},n.prototype.getVirtualUrl=function(t){return t},n.getNetContext=function(){return null==n._instance&&(n._instance=new n),n._instance},n}(t.HashObject);e.HTML5NetContext=n,__reflect(n.prototype,"egret.web.HTML5NetContext",["egret.NetContext"]),t.NetContext=n}(e=t.web||(t.web={}))}(egret||(egret={}));

+ 1469
- 0
libs/modules/res/res.d.ts
File diff suppressed because it is too large
View File


+ 3515
- 0
libs/modules/res/res.js
File diff suppressed because it is too large
View File


+ 1
- 0
libs/modules/res/res.min.js
File diff suppressed because it is too large
View File


+ 1345
- 0
libs/modules/tween/tween.d.ts
File diff suppressed because it is too large
View File


+ 2076
- 0
libs/modules/tween/tween.js
File diff suppressed because it is too large
View File


+ 1
- 0
libs/modules/tween/tween.min.js
File diff suppressed because it is too large
View File


BIN
resource/assets/loading/loading_bg.png View File

Before After
Width: 591  |  Height: 33  |  Size: 1.2KB

BIN
resource/assets/loading/loading_tiao.png View File

Before After
Width: 587  |  Height: 28  |  Size: 2.0KB

BIN
resource/assets/loading/loading_txt.png View File

Before After
Width: 114  |  Height: 31  |  Size: 585B

BIN
resource/assets/loading/loading_view.png View File

Before After
Width: 89  |  Height: 89  |  Size: 2.6KB

BIN
resource/assets/loading/logo.png View File

Before After
Width: 250  |  Height: 250  |  Size: 42KB

BIN
resource/assets/sound/bg.mp3 View File


BIN
resource/assets/sound/button.mp3 View File


BIN
resource/assets/sound/dazhao.mp3 View File


BIN
resource/assets/sound/gongji.mp3 View File


BIN
resource/assets/sound/jieshu2.mp3 View File


BIN
resource/assets/sound/shibai.mp3 View File


BIN
resource/assets/sound/siwang1.mp3 View File


BIN
resource/assets/ui/hall/1_10.png View File

Before After
Width: 402  |  Height: 559  |  Size: 80KB

BIN
resource/assets/ui/hall/1_8.png View File

Before After
Width: 629  |  Height: 678  |  Size: 124KB

BIN
resource/assets/ui/hall/1_9.png View File

Before After
Width: 573  |  Height: 569  |  Size: 245KB

BIN
resource/assets/ui/hall/4_1.png View File

Before After
Width: 750  |  Height: 1334  |  Size: 40KB

BIN
resource/assets/ui/hall/4_14.png View File

Before After
Width: 672  |  Height: 928  |  Size: 9.6KB

BIN
resource/assets/ui/hall/4_5.png View File

Before After
Width: 667  |  Height: 566  |  Size: 26KB

+ 47
- 0
resource/assets/ui/hall/HallUI_200214184735.json View File

@@ -0,0 +1,47 @@
{"texture":
{
"btn1_1":{"x":1342, "y":401, "w":185, "h":258},
"btn1_2":{"x":0, "y":661, "w":189, "h":259},
"btn1_3":{"x":598, "y":401, "w":185, "h":252},
"btn2_1":{"x":970, "y":401, "w":185, "h":258},
"btn2_2":{"x":190, "y":661, "w":189, "h":259},
"btn2_3":{"x":784, "y":401, "w":185, "h":252},
"btn3_1":{"x":1156, "y":401, "w":185, "h":258},
"btn3_2":{"x":1528, "y":401, "w":189, "h":259},
"btn3_3":{"x":412, "y":401, "w":185, "h":252},
"1_11":{"x":714, "y":930, "w":440, "h":319},
"2_2":{"x":0, "y":1279, "w":750, "h":371},
"1_7":{"x":1019, "y":661, "w":486, "h":268},
"1_4":{"x":568, "y":200, "w":104, "h":136},
"1_5":{"x":1656, "y":0, "w":106, "h":91},
"1_6":{"x":0, "y":401, "w":254, "h":224},
"1_2":{"x":380, "y":661, "w":638, "h":266},
"1_3":{"x":1098, "y":0, "w":326, "h":42},
"3_4":{"x":1155, "y":930, "w":303, "h":336},
"3_8":{"x":1486, "y":0, "w":88, "h":72},
"3_1":{"x":0, "y":0, "w":354, "h":24},
"3_2":{"x":737, "y":0, "w":170, "h":36},
"5_1":{"x":459, "y":0, "w":277, "h":34},
"5_2":{"x":628, "y":92, "w":802, "h":104},
"2_1":{"x":0, "y":930, "w":495, "h":298},
"2_6":{"x":1459, "y":930, "w":342, "h":348},
"2_4":{"x":1571, "y":200, "w":106, "h":147},
"2_5":{"x":355, "y":0, "w":103, "h":33},
"2_3":{"x":1678, "y":200, "w":123, "h":200},
"2_7":{"x":255, "y":401, "w":156, "h":231},
"tishi4":{"x":1217, "y":200, "w":353, "h":141},
"tishi5":{"x":0, "y":92, "w":63, "h":92},
"4_2":{"x":496, "y":930, "w":217, "h":316},
"4_3":{"x":945, "y":200, "w":271, "h":139},
"4_4":{"x":673, "y":200, "w":271, "h":139},
"4_7":{"x":606, "y":92, "w":21, "h":102},
"4_9":{"x":0, "y":200, "w":567, "h":118},
"4_6":{"x":1425, "y":0, "w":60, "h":60},
"4_15":{"x":1575, "y":0, "w":80, "h":81},
"1_1":{"x":64, "y":92, "w":270, "h":94},
"logo1_1":{"x":908, "y":0, "w":189, "h":42},
"logo1":{"x":335, "y":92, "w":270, "h":96},
"logo3":{"x":1431, "y":92, "w":274, "h":107}
},
"group":"HallUI"
}

BIN
resource/assets/ui/hall/HallUI_200214184735.png View File

Before After
Width: 1839  |  Height: 1693  |  Size: 399KB

+ 23
- 0
resource/assets/ui/hall/HallUI_loader_200214184735.json View File

@@ -0,0 +1,23 @@
{
"resources":[
{"name":"HallUI_img","type":"image","url":"assets/ui/hall/HallUI_200214184735.png"},
{"name":"HallUI_json","type":"json","url":"assets/ui/hall/HallUI_200214184735.json"},
{"name":"bg1","type":"image","url":"assets/ui/hall/bg1.jpg?ver=200214184735"},
{"name":"1_10","type":"image","url":"assets/ui/hall/1_10.png?ver=200214184735"},
{"name":"1_8","type":"image","url":"assets/ui/hall/1_8.png?ver=200214184735"},
{"name":"1_9","type":"image","url":"assets/ui/hall/1_9.png?ver=200214184735"},
{"name":"bg2","type":"image","url":"assets/ui/hall/bg2.jpg?ver=200214184735"},
{"name":"tishi1","type":"image","url":"assets/ui/hall/tishi1.png?ver=200214184735"},
{"name":"tishi2","type":"image","url":"assets/ui/hall/tishi2.png?ver=200214184735"},
{"name":"tishi3","type":"image","url":"assets/ui/hall/tishi3.png?ver=200214184735"},
{"name":"4_1","type":"image","url":"assets/ui/hall/4_1.png?ver=200214184735"},
{"name":"4_5","type":"image","url":"assets/ui/hall/4_5.png?ver=200214184735"},
{"name":"4_14","type":"image","url":"assets/ui/hall/4_14.png?ver=200214184735"},
{"name":"bg2_1","type":"image","url":"assets/ui/hall/bg2_1.jpg?ver=200214184735"},
{"name":"bg2_2","type":"image","url":"assets/ui/hall/bg2_2.jpg?ver=200214184735"},
{"name":"bg2_3","type":"image","url":"assets/ui/hall/bg2_3.jpg?ver=200214184735"}
],
"groups":[
{"name":"hall_HallUI","keys":"HallUI_img,HallUI_json,bg1,1_10,1_8,1_9,bg2,tishi1,tishi2,tishi3,4_1,4_5,4_14,bg2_1,bg2_2,bg2_3"}
]
}

BIN
resource/assets/ui/hall/bg1.jpg View File

Before After
Width: 750  |  Height: 1506  |  Size: 83KB

BIN
resource/assets/ui/hall/bg2.jpg View File

Before After
Width: 750  |  Height: 1506  |  Size: 69KB

BIN
resource/assets/ui/hall/bg2_1.jpg View File

Before After
Width: 750  |  Height: 1334  |  Size: 132KB

BIN
resource/assets/ui/hall/bg2_2.jpg View File

Before After
Width: 750  |  Height: 1334  |  Size: 133KB

BIN
resource/assets/ui/hall/bg2_3.jpg View File

Before After
Width: 750  |  Height: 1334  |  Size: 177KB

BIN
resource/assets/ui/hall/bg3.jpg View File

Before After
Width: 750  |  Height: 1506  |  Size: 92KB

+ 18
- 0
resource/assets/ui/hall/temp_game_200214111114.json View File

@@ -0,0 +1,18 @@
{"texture":
{
"3_3":{"x":312, "y":0, "w":174, "h":184},
"3_5":{"x":188, "y":0, "w":30, "h":30},
"3_6":{"x":126, "y":0, "w":30, "h":30},
"3_7":{"x":219, "y":0, "w":30, "h":30},
"dian1_3":{"x":157, "y":0, "w":30, "h":30},
"dian1_2":{"x":101, "y":0, "w":24, "h":24},
"dian1_1":{"x":0, "y":0, "w":16, "h":16},
"dian2_3":{"x":281, "y":0, "w":30, "h":30},
"dian2_2":{"x":76, "y":0, "w":24, "h":24},
"dian2_1":{"x":34, "y":0, "w":16, "h":16},
"dian3_3":{"x":250, "y":0, "w":30, "h":30},
"dian3_2":{"x":51, "y":0, "w":24, "h":24},
"dian3_1":{"x":17, "y":0, "w":16, "h":16}
},
"group":"temp_game"
}

BIN
resource/assets/ui/hall/temp_game_200214111114.png View File

Before After
Width: 487  |  Height: 198  |  Size: 11KB

+ 9
- 0
resource/assets/ui/hall/temp_game_loader_200214111114.json View File

@@ -0,0 +1,9 @@
{
"resources":[
{"name":"temp_game_img","type":"image","url":"assets/ui/hall/temp_game_200214111114.png"},
{"name":"temp_game_json","type":"json","url":"assets/ui/hall/temp_game_200214111114.json"}
],
"groups":[
{"name":"hall_temp_game","keys":"temp_game_img,temp_game_json"}
]
}

+ 8
- 0
resource/assets/ui/hall/temp_music_200212133421.json View File

@@ -0,0 +1,8 @@
{"texture":
{
"music1":{"x":0, "y":0, "w":42, "h":42},
"music2":{"x":43, "y":0, "w":42, "h":42},
"music01":{"x":86, "y":0, "w":58, "h":58}
},
"group":"temp_music"
}

BIN
resource/assets/ui/hall/temp_music_200212133421.png View File

Before After
Width: 145  |  Height: 62  |  Size: 2.6KB

+ 9
- 0
resource/assets/ui/hall/temp_music_loader_200212133421.json View File

@@ -0,0 +1,9 @@
{
"resources":[
{"name":"temp_music_img","type":"image","url":"assets/ui/hall/temp_music_200212133421.png"},
{"name":"temp_music_json","type":"json","url":"assets/ui/hall/temp_music_200212133421.json"}
],
"groups":[
{"name":"hall_temp_music","keys":"temp_music_img,temp_music_json"}
]
}

+ 11
- 0
resource/assets/ui/hall/temp_rank_200213114628.json View File

@@ -0,0 +1,11 @@
{"texture":
{
"4_13":{"x":0, "y":0, "w":564, "h":3},
"4_10":{"x":0, "y":84, "w":554, "h":93},
"4_11":{"x":1240, "y":0, "w":536, "h":83},
"4_12":{"x":565, "y":0, "w":512, "h":67},
"4_16":{"x":1159, "y":0, "w":80, "h":81},
"4_8":{"x":1078, "y":0, "w":80, "h":80}
},
"group":"temp_rank"
}

BIN
resource/assets/ui/hall/temp_rank_200213114628.png View File

Before After
Width: 1778  |  Height: 184  |  Size: 14KB

+ 9
- 0
resource/assets/ui/hall/temp_rank_loader_200213114628.json View File

@@ -0,0 +1,9 @@
{
"resources":[
{"name":"temp_rank_img","type":"image","url":"assets/ui/hall/temp_rank_200213114628.png"},
{"name":"temp_rank_json","type":"json","url":"assets/ui/hall/temp_rank_200213114628.json"}
],
"groups":[
{"name":"hall_temp_rank","keys":"temp_rank_img,temp_rank_json"}
]
}

BIN
resource/assets/ui/hall/tishi1.png View File

Before After
Width: 418  |  Height: 440  |  Size: 42KB

BIN
resource/assets/ui/hall/tishi2.png View File

Before After
Width: 584  |  Height: 559  |  Size: 50KB

BIN
resource/assets/ui/hall/tishi3.png View File

Before After
Width: 403  |  Height: 538  |  Size: 19KB

+ 8
- 0
resource/assets/ui/load/LoadMian_200212144747.json View File

@@ -0,0 +1,8 @@
{"texture":
{
"load1":{"x":934, "y":0, "w":198, "h":176},
"load2":{"x":439, "y":0, "w":494, "h":82},
"load3":{"x":0, "y":0, "w":438, "h":20}
},
"group":"LoadMian"
}

BIN
resource/assets/ui/load/LoadMian_200212144747.png View File

Before After
Width: 1133  |  Height: 180  |  Size: 12KB

BIN
resource/assets/ui/load/loadbg.jpg View File

Before After
Width: 750  |  Height: 1334  |  Size: 39KB

+ 28
- 0
resource/easygame_config.json View File

@@ -0,0 +1,28 @@
{
"name":"506_virus",
"product":"virus",
"version":"0.0.1",
"version_res":"200214184735",
"desc":"可自行加入其它配置信息,信息内容自行读取",
"report":{
"desc":"报表设置,name:渠道的名称,rate:汇率,unit:货币单位,storage:存储(local/net)",
"url":"http://www.easygame.org/",
"provide":1,
"channel":[
{"id":1, "app_id":"", "name":"easygame", "rate":1, "unit":"元", "storage":"local", "report":false}
]
},
"dev":{
"desc":"开发模式设置,scale_mode:适配方式,debug:debug开关,loading_max:并发下载最大限制",
"scale_mode":"easygame",
"debug":"false",
"loading_max":5
},
"statistics":{
"view":false,
"win":false,
"btn":false,
"mc":false,
"list":false
}
}

+ 10
- 0
resource/loading_main.json View File

@@ -0,0 +1,10 @@
{
"resources":[
{"name":"LoadMian_img","type":"image","url":"assets/ui/load/LoadMian_200212144747.png"},
{"name":"LoadMian_json","type":"json","url":"assets/ui/load/LoadMian_200212144747.json"},
{"name":"loadbg","type":"image","url":"assets/ui/load/loadbg.jpg?ver=200212144747"}
],
"groups":[
{"name":"loading_main","keys":"LoadMian_img,LoadMian_json,loadbg"}
]
}

+ 11
- 0
resource/loading_view.json View File

@@ -0,0 +1,11 @@
{
"resources":
[
{"name":"loading_view","type":"image","url":"assets/loading/loading_view.png"}
],

"groups":
[
{"name":"loading_view","keys":"loading_view"}
]
}

+ 13
- 0
resource/resource.json View File

@@ -0,0 +1,13 @@
{
"resources":
[
{"name":"easygame_config","type":"json","url":"easygame_config.json"},
{"name":"sound_button","type":"sound","soundType":"effect","url":"assets/sound/button.mp3"}
],

"groups":
[
{"name":"sound","keys":"sound_button"},
{"name":"group_easygame_config","keys":"easygame_config"}
]
}

+ 137
- 0
src/LoadingUI.ts View File

@@ -0,0 +1,137 @@
import GlobalSetting = easy.GlobalSetting;
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class LoadingUI extends easy.BaseGroup {
public groupProgress:easy.BaseGroup = null;
public imgTiaoBg:easy.Image = null;
public imgTiao:easy.Image = null;
public imgTxt:easy.Image = null;
public imgLogo:easy.Image = null;
public groupMask:easy.Group = null;


public constructor() {
super();
}

/**
* 初始化主场景的组件
* 这个方法在对象new的时候就调用,因为有些ui必须在加入stage之前就准备好
* 子类覆写该方法,添加UI逻辑
*/
public createChildren():void {
super.createChildren();

this.setSize(easy.GlobalSetting.STAGE_WIDTH, easy.GlobalSetting.STAGE_HEIGHT);

//groupProgress
this.groupProgress = new easy.BaseGroup(true);
this.groupProgress.name = "groupProgress";
this.addChild(this.groupProgress);
this.groupProgress.width = 500;
this.groupProgress.height = 500;

this.groupProgress.x = easy.GlobalSetting.DISPLAY_WIDTH/2 - this.groupProgress.cx;
this.groupProgress.y = easy.GlobalSetting.DISPLAY_HEIGHT/2 - this.groupProgress.cy;

//imgTiaoBg
this.imgTiaoBg = new easy.Image(true);
this.imgTiaoBg.name = "imgTiaoBg";
this.groupProgress.addChild(this.imgTiaoBg);
this.imgTiaoBg.x = -45.5;
this.imgTiaoBg.y = 324.5;
this.imgTiaoBg.width = 591;
this.imgTiaoBg.height = 33;

//imgTxt
this.imgTxt = new easy.Image(true);
this.imgTxt.name = "imgTxt";
this.groupProgress.addChild(this.imgTxt);
this.imgTxt.x = 193;
this.imgTxt.y = 384.5;
this.imgTxt.width = 114;
this.imgTxt.height = 31;
//imgLogo
this.imgLogo = new easy.Image(true);
this.imgLogo.name = "imgLogo";
this.groupProgress.addChild(this.imgLogo);
this.imgLogo.x = 125;
this.imgLogo.width = 250;
this.imgLogo.height = 250;

//groupMask
this.groupMask = new easy.Group(true);
this.groupMask.name = "groupMask";
this.groupProgress.addChild(this.groupMask);
this.groupMask.x = -43.5;
this.groupMask.y = 327;
this.groupMask.width = 587;
this.groupMask.height = 28;
this.groupMask.showBg = false;
this.groupMask.width = 1;
this.groupMask.clip = true;

//imgTiao
this.imgTiao = new easy.Image(true);
this.imgTiao.name = "imgTiao";
this.groupMask.addChild(this.imgTiao);
this.imgTiao.width = 587;
this.imgTiao.height = 28;

//设置材质
this.groupProgress.drawDelay = false;
this.imgTiaoBg.texture = RES.getRes("loading_bg");
this.imgTiaoBg.drawDelay = false;
this.imgTiao.texture = RES.getRes("loading_tiao");
this.imgTiao.drawDelay = false;
this.imgTxt.texture = RES.getRes("loading_txt");
this.imgTxt.drawDelay = false;
this.imgLogo.texture = RES.getRes("logo");
this.imgLogo.drawDelay = false;
this.groupMask.drawDelay = false;
}

/**
* 进度的展示
* @param current
* @param total
*/
public setProgress(current, total):void {
this.groupMask.width = this.imgTiao.width * (current / total);
}
/**
* loading enter
*/
public enter():void {
}
/**
* loading outer
*/
public outer():void {
this.removeFromParent();
}
}

+ 215
- 0
src/Main.ts View File

@@ -0,0 +1,215 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

class Main extends egret.DisplayObjectContainer {

/**
* 加载进度界面
* Process interface loading
*/
private loadingMain:virus.LoadMianProgressMainBar;//loading main
//RES资源全部下载完成
private loadResAllComplete:boolean = false;
//easy game的配置文件时候下载完成
private _isEasyGameOk:boolean = false;//游戏配置下载完毕
private _isSoundOk:boolean = false;//声音准备完毕
private _isProjectUIOk:boolean = false;//公用UI下载完毕
private _isCreateScene:boolean = false//是否已创建场景
private _isLoadingViewOk:boolean = false;//view的loading是否准备好了
private _progressCalculate:easy.ProgressCalculate = null;
private _isViewEnter:boolean = false;//第一个加载的view是否已经准备完成

public constructor() {
super();
this.loadResAllComplete = false;
this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
}

private onAddToStage(event: egret.Event) {
egret.ImageLoader.crossOrigin = "anonymous";
//初始化全局数据,以便Heatbeat可以使用
easy.GlobalSetting.initData();
//初始化Resource资源加载库
easy.ResManager.loadConfig(easy.GlobalSetting.CDN_RES + "loading_main.json", ["loading_main"], this.onResLoadingMianComplete,this);
//下载loading view的内容
easy.ResManager.loadConfig(easy.GlobalSetting.CDN_RES + "loading_view.json", ["loading_view"], this.onResLoadingViewComplete,this);
easy.EventManager.addEventListener(easy.EventType.VIEW_ENTER, this.onHiddenloadingMain, this);
}
/**
* loading view配置文件的加载完成
* @param event
*/
private onResLoadingViewComplete(event:RES.ResourceEvent):void{
this._isLoadingViewOk = true;
}
/**
* loading main配置文件的加载完成
* @param event
*/
private onResLoadingMianComplete(event:RES.ResourceEvent):void{
//console.log("@Main onLoadingMianResourceLoadComplete=" + event.groupName);
if(RES.isGroupLoaded("loading_main")){
//设置加载进度界面
this.loadingMain = new virus.LoadMianProgressMainBar();//loading main
this.stage.addChild(this.loadingMain);
this.loadingMain.width = easy.GlobalSetting.DISPLAY_WIDTH;
this.loadingMain.height = easy.GlobalSetting.DISPLAY_HEIGHT;
this.loadingMain.enter();
//启动进度条计数
this._progressCalculate = new easy.ProgressCalculate(10);
easy.HeartBeat.addListener(this,this.onHbProgress,2);

//初始化Resource资源加载库
easy.ResManager.loadConfig(easy.GlobalSetting.CDN_RES + "resource.json", ["group_easygame_config"], this.onResLoadGameConfigComplete, this);
//提前加载Json数据,创建场景的时候,可能就需要用到数据了
//virus.DataManager.loadJsonFile();

//加载公用资源,如果设置有公用资源请打开此项
//easy.ResManager.loadResFile("virus");
//easy.EventManager.addEventListener(easy.EventType.PROJECT_RES_DOWNLOADED, this.onProjectResDownloaded, this);
this._isProjectUIOk = true;
}
}
/**
* 控制进度条
* @type {number}
*/
private onHbProgress():void{
var progress:number = this._progressCalculate.progress();
this._progressCalculate._progressSpeedUp = (this.loadResAllComplete && this._isProjectUIOk && this._isViewEnter);
this.loadingMain.setProgress(progress,100);
if (this.loadResAllComplete && !this._isCreateScene && this._isLoadingViewOk) this.createScene();
if (progress == 100) {
easy.HeartBeat.removeListener(this, this.onHbProgress);
this.removeLoadingUI();
}
}
/**
* 将loading页面移除,开始创建场景
*/
private removeLoadingUI():void{
if (this.loadingMain) {
this.loadingMain.outer();
}
}
/**
* 公用资源加载完成的通知
* @param myEvent
*/
private onProjectResDownloaded(myEvent:easy.MyEvent):void {
easy.EventManager.removeEventListener(easy.EventType.PROJECT_RES_DOWNLOADED, this.onProjectResDownloaded, this);
this._isProjectUIOk = true;
this.checkAllResourceLoaded();
}
/**
* preload资源组加载完成
*/
private onResLoadGameConfigComplete(event:RES.ResourceEvent):void {
//console.log("@Main onResourceLoadComplete=" + event.groupName);
if(RES.isGroupLoaded("group_easygame_config")) {
this._isEasyGameOk = true;
//下载全部完成
//设置帧频
easy.GlobalSetting.FRAME_RATE = 60;
//EasyGame初始化
easy.EasyGame.init();
//设置界面切换的loading,view的loading和Win的loading可以设置成不一样的类
easy.ViewManager.defaultLoadingClass = virus.LoadViewProgressViewBar;//loading view
easy.PopupManager.defaultLoadingClass = virus.LoadViewProgressViewBar;//loading view
}
this.checkAllResourceLoaded();
}
/**
* 声音加载完成
*/
private onResLoadSoundComplete(event:RES.ResourceEvent):void {
//console.log("@Main onResourceLoadComplete=" + event.groupName);
if(RES.isGroupLoaded("sound")) {
this._isSoundOk = true;
//声音加载完毕,播放背景音文件
//easy.Sound.play("sound_bg", 0 , 0);
}
}
/**
* 检测是否所有需要的资源全部加载完成
* 下载全部完成的情况下设置loadAllComplete标志,等待loading的全部反应
*/
private checkAllResourceLoaded():void {
if(this._isEasyGameOk && this._isProjectUIOk){
//创建场景
if (easy.GlobalSetting.APP_STORAGE == easy.GlobalSetting.STORAGE_NET || easy.GlobalSetting.APP_STORAGE == easy.GlobalSetting.STORAGE_LOCAL_NET){
this.loadDataFromNet();
} else{
this.loadResAllComplete = true;
}
}
}

/**
* 隐藏加载进度条
*/
private onHiddenloadingMain(myEvent:easy.MyEvent):void {
this._isViewEnter = true;
easy.EventManager.removeEventListener(easy.EventType.VIEW_ENTER, this.onHiddenloadingMain, this);
//声音加载
//easy.ResManager.addGroupCompleteListener("sound", this.onResLoadSoundComplete, this);
}

/**
* 需要从网络初始化信息
*/
private loadDataFromNet():void {
//TODO 这里填写需要网络加载的信息,完成后,请调用loadDataFromNetComplete()方法,加载主场景
//this.loadDataFromNetComplete();
}

/**
* 从网络加载初始化信息完成
*/
private loadDataFromNetComplete():void {
//TODO 网络信息的初始化,请在这里填写
this.loadResAllComplete = true;
}
/**
* 创建场景
*/
private createScene():void{
if (this._isCreateScene) return;//防止多次创建
this._isCreateScene = true;
//console.log("main.createScene")
//TODO 提前预设空闲下载,加快后续的模块载入速度
easy.ResManager.addIdleDownload(virus.temp_gameTemplate);
easy.ResManager.addIdleDownload(virus.temp_rankTemplate);
//TODO 动画的预加载方式
//easy.AnimateManager.getAnimateData("need_to_download_name");
//TODO 切换到第一个主场景
virus.GameData.get_rank(1);
easy.ViewManager.show(virus.HallView, null, false);
}
}

+ 146
- 0
src/org/easygame/animate/AnimateData.ts View File

@@ -0,0 +1,146 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
/**
* 动画数据
*/
export class AnimateData {
public id:string = null;//数据id
public frame:number = 0;//帧数
public _json:any = null;//材质json定义

public width:number = 0;
public height:number = 0;
public _spriteSheet:egret.SpriteSheet = null;
public textures:Array<AnimateTexture> = null;//通用动画材质
public textureDict:any = null;
private _type:string = AnimateData.TYPE_EFFECT;
public _merge:boolean = true;//材质是否是合并输出的

public static TYPE_ACTOR:string = "actor";//人物动画材质
public static TYPE_EFFECT:string = "effect";//普通动画效果

public constructor(name:string) {
this.id = name;
var jsonData:any = RES.getRes(name + "_animate_json");
if (jsonData != null) {
this.textureDict = {};
this.id = jsonData.id;
this.frame = jsonData.frame;
this._type = jsonData.type;
if (jsonData.merge) this._merge = (jsonData.merge == "true");
var animateTexture:AnimateTexture = null;
if (this._merge){
this._spriteSheet = new egret.SpriteSheet(RES.getRes(name + "_animate_img"));
}
if (jsonData.type == "actor") {
var textureArr:Array<AnimateTexture> = null;
for (var key in jsonData.texture){
textureArr = [];
this.textureDict[key] = textureArr;
for(var i = 0; i < jsonData.texture[key].length; i++) {
animateTexture = new easy.AnimateTexture();
animateTexture.width = jsonData.texture[key][i].w;
animateTexture.height = jsonData.texture[key][i].h;
animateTexture.id = jsonData.texture[key][i].id;
if (animateTexture.width > this.width) this.width = animateTexture.width;
if (animateTexture.height > this.height) this.height = animateTexture.height;
if (jsonData.texture[key][i].f) {
animateTexture.frame = jsonData.texture[key][i].f;
}else {
animateTexture.frame = this.frame;
}
animateTexture.x = jsonData.texture[key][i].ox;
animateTexture.y = jsonData.texture[key][i].oy;
if (this._merge) {
animateTexture.offsetX = jsonData.texture[key][i].x;
animateTexture.offsetY = jsonData.texture[key][i].y;
animateTexture.texutre = this._spriteSheet.createTexture(key + "_" + i, animateTexture.offsetX, animateTexture.offsetY, animateTexture.width, animateTexture.height);
} else {
animateTexture.resId = jsonData.texture[key][i].l;
animateTexture.texutre = RES.getRes(animateTexture.resId);
}
textureArr.push(animateTexture);
}
}
} else {
this.textures = [];
for(var i = 0; i < jsonData.texture.length; i++) {
animateTexture = new easy.AnimateTexture();
animateTexture.width = jsonData.texture[i].w;
animateTexture.height = jsonData.texture[i].h;
animateTexture.id = jsonData.texture[i].id;
if (animateTexture.width > this.width) this.width = animateTexture.width;
if (animateTexture.height > this.height) this.height = animateTexture.height;
if (jsonData.texture[i].f) {
animateTexture.frame = jsonData.texture[i].f;
}else {
animateTexture.frame = this.frame;
}
animateTexture.x = jsonData.texture[i].ox;
animateTexture.y = jsonData.texture[i].oy;
if (this._merge) {
animateTexture.offsetX = jsonData.texture[i].x;
animateTexture.offsetY = jsonData.texture[i].y;
animateTexture.texutre = this._spriteSheet.createTexture(this.id + "_" + i, animateTexture.offsetX, animateTexture.offsetY, animateTexture.width, animateTexture.height);
} else {
animateTexture.resId = jsonData.texture[i].l;
animateTexture.texutre = RES.getRes(animateTexture.resId);
}

this.textures.push(animateTexture);
}
}
}
}

/**
* 获取通用动画材质数据
*/
public getTexture(index:number):AnimateTexture {
if (index >= 0 && index < this.textures.length){
return this.textures[index];
}
return null;
}

/**
* 获取人物动画材质
* @param direction
* @param index
* @returns {null}
*/
public getTextureActor(direction:string, index:number):AnimateTexture {
if (this.textureDict[direction] && index >= 0) {
if (index < this.textureDict[direction].length){
return this.textureDict[direction][index];
}
}
return null;
}
}
}

+ 118
- 0
src/org/easygame/animate/AnimateManager.ts View File

@@ -0,0 +1,118 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
/**
* 动画数据
*/
export class AnimateManager {
private static _animiateDataDict:any = {};

private static waiting_groups:Array<string> = [];//等待下载的group列表
private static waiting_names:Array<string> = [];//等待下载的name列表
private static names_down:Array<string> = [];//已下载的那么集合

/**
* 获取动画数据
*/
public static getAnimateData(name:string):AnimateData{
//easy.Debug.log = "getAnimateData=" + name;
if (AnimateManager._animiateDataDict[name]) {
return AnimateManager._animiateDataDict[name];
}
if (RES.isGroupLoaded(name + "_animate_group")) {
AnimateManager._animiateDataDict[name] = new AnimateData(name);
return AnimateManager._animiateDataDict[name];
} else {
AnimateManager.loadAnimate(name);
}
return null;
}
/**
* url加载json data数据到RES中
*/
public static loadAnimate(name:string):void {
if (!easy.StringUtil.isUsage(name)) return;
if (AnimateManager.names_down.indexOf(name) >= 0 || RES.isGroupLoaded(name + "_animate_group")) return;
if (AnimateManager.waiting_groups.indexOf(name) < 0) AnimateManager.waiting_groups.push(name);
if (AnimateManager.waiting_names.indexOf(name) < 0) AnimateManager.waiting_names.push(name);
AnimateManager.names_down.push(name);
easy.HeartBeat.addListener(AnimateManager, AnimateManager.onHeartBeatCheckLoadedFile, 60);
}

/**
* 开始下载数据
* @param name
*/
private static fireDownAnimate(name:string):void {
if (easy.GlobalSetting.isNative()){
ResManager.loadConfig(RES.getVersionController().getVirtualUrl(easy.GlobalSetting.CDN_RES + "assets/animate/" + name + "_loader.json"), [name + "_animate_group"], AnimateManager.onLoadingGroupJosnFileComplete, AnimateManager);
} else {
ResManager.loadConfig(easy.GlobalSetting.CDN_RES + "assets/animate/" + name + "_loader.json?r=" + Math.floor(Math.random()*9999999999), [name + "_animate_group"], AnimateManager.onLoadingGroupJosnFileComplete, AnimateManager);
}
}
/**
* loading配置文件的Group加载完成
* @param event
*/
private static onLoadingGroupJosnFileComplete(event:RES.ResourceEvent):void{
//console.log("animate load complete!!!=" + event.groupName);
if (event && easy.StringUtil.isUsage(event.groupName) && event.groupName.indexOf("_animate_group") >=0) {
var groupName:string = event.groupName.substring(0, event.groupName.indexOf("_animate_group"));
if (AnimateManager.waiting_names.indexOf(groupName) >= 0) AnimateManager.waiting_names.splice(AnimateManager.waiting_names.indexOf(groupName),1);
if (AnimateManager.waiting_groups.indexOf(groupName) >= 0) AnimateManager.waiting_groups.splice(AnimateManager.waiting_groups.indexOf(groupName),1);
var myEvent:MyEvent = MyEvent.getEvent(EventType.RESOURCE_DOWNLOADED);
myEvent.addItem("name", groupName);
myEvent.send();
}
AnimateManager.onHeartBeatCheckLoadedFile();
}

/**
* 检测是否有文件没有下载完成,重新加入下载列表中
*/
private static onHeartBeatCheckLoadedFile():void {
if (AnimateManager.waiting_groups.length == 0 && AnimateManager.waiting_names.length == 0) {
easy.HeartBeat.removeListener(AnimateManager, AnimateManager.onHeartBeatCheckLoadedFile);
}
if(AnimateManager.waiting_groups.length > 0 && AnimateManager.waiting_names.length > 0){
var reloadArr:Array<string> = [];
for(var i = AnimateManager.waiting_names.length-1; i >= 0; i--) {
if (AnimateManager.waiting_groups.indexOf(AnimateManager.waiting_names[i]) >= 0) {
reloadArr.push(AnimateManager.waiting_names[i]);
AnimateManager.waiting_names.splice(i,1);
AnimateManager.waiting_groups.splice(AnimateManager.waiting_groups.indexOf(AnimateManager.waiting_names[i]),1);
}
}
var resName:string = null;
while(reloadArr.length > 0) {
//easy.Debug.log = "onHeartBeatCheckLoadedFile 111111111111111";
AnimateManager.fireDownAnimate(reloadArr.pop());
}
}
}
}
}

+ 45
- 0
src/org/easygame/animate/AnimateTexture.ts View File

@@ -0,0 +1,45 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
/**
* 动画元数据
*/
export class AnimateTexture {
public id:string = null;//名称
public frame:number = 0;//播放时长
public width:number = 0;//材质宽
public height:number = 0;//材质高
public x:number = 0;//x值
public y:number = 0;//y值
public offsetX:number = 0;//offset x值
public offsetY:number = 0;//offset y值
public texutre:egret.Texture = null;//材质
public resId:string = null;//不合并的时候的资源id
public constructor() {
}
}
}

+ 194
- 0
src/org/easygame/component/DebugWin.ts View File

@@ -0,0 +1,194 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
/**
* Debug信息显示窗口
*/
export class DebugWin extends Win {
//操作按钮容器
private _bottomContainer:Group = null;
//顶部信息容器
private _topContainer:Group = null;
private _labelTitle:Label = null;

//内容显示
private _textInfo:egret.TextField = null;
//关闭按钮
private _btnClose:Button = null;
//清除
private _btnClean:Button = null;
//刷新按钮
private _btnRefresh:Button = null;
/**
* view成对应的ui展现
* @type {null}
* @private
*/

public constructor() {
super();
}
/**
* 初始化ui数据
* 这个方法在对象new的时候就调用,因为有些ui必须在加入stage之前就准备好
*/
public createChildren():void{
super.createChildren();
this.y = 80;
//窗口宽高
this.width = 400;
this.height = GlobalSetting.STAGE_HEIGHT - this.y;
//顶部信息设置
this._topContainer = new Group();
this.addChild(this._topContainer);
this._topContainer.height = 35;
this._topContainer.width = this.width;
this._topContainer.y = 0;

this._labelTitle = new Label();
this._topContainer.addChild(this._labelTitle);
this._labelTitle.text = "Debug窗口";

//底部按钮设置
//按钮容器
this._bottomContainer = new Group();
this.addChild(this._bottomContainer);
this._bottomContainer.height = 42;
this._bottomContainer.width = this.width;
this._bottomContainer.y = this.height - this._bottomContainer.height;
//刷新按钮
this._btnRefresh = new Button();
this._bottomContainer.addChild(this._btnRefresh);
this._btnRefresh.label = "刷新";
this._btnRefresh.x = 2;
this._btnRefresh.y = 2;
this._btnRefresh.setSize(125, 40);
this._btnRefresh.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchRegresh, this);

//关闭按钮
this._btnClose = new Button();
this._bottomContainer.addChild(this._btnClose);
this._btnClose.x = this._btnRefresh.x + this._btnRefresh.width + 8;
this._btnClose.y = 2;
this._btnClose.label = "关闭";
this._btnClose.setSize(125, 40);
this._btnClose.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchClose, this);

//清除按钮
this._btnClean = new Button();
this._bottomContainer.addChild(this._btnClean);
this._btnClean.x = this._btnClose.x + this._btnClose.width + 8;
this._btnClean.y = 2;
this._btnClean.label = "清除";
this._btnClean.setSize(125, 40);
this._btnClean.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchClean, this);

//内容显示设置
var textBg:Group = new Group();
this.addChild(textBg);
textBg.bgColor = 0xffffff;
textBg.x = 0;
textBg.y = this._topContainer.height + 1;
textBg.width = this.width;
textBg.height = this.height - this._topContainer.height - this._bottomContainer.height - 2;

this._textInfo = new egret.TextField();
this.addChild(this._textInfo);
this._textInfo.multiline = true;
this._textInfo.textColor = 0x000000;
this._textInfo.size = 16;
this._textInfo.lineSpacing = 6;
this._textInfo.x = textBg.x + 1;
this._textInfo.y = textBg.y;
this._textInfo.width = textBg.width;
this._textInfo.height = textBg.height;
this.showBg = true;
}

/**
* 刷新内容事件
* @param event
*/
private onTouchRegresh(event:egret.TouchEvent):void {
this._textInfo.text = Debug.log;
}
/**
* 关闭窗口事件
* @param event
*/
private onTouchClose(event:egret.TouchEvent):void {
DebugWin.hidden();
}
/**
* 清除记录
* @param event
*/
private onTouchClean(event:egret.TouchEvent):void {
Debug.clean();
this.onTouchRegresh(event);
}


//单例调用
public static _instance:DebugWin = null;

/**
* 显示
*/
public static show():void {
if (DebugWin._instance == null) {
DebugWin._instance = new DebugWin();
}
GlobalSetting.STAGE.addChild(DebugWin._instance);
}
/**
* view进入的逻辑
* 可以再次根据外部数据情况做一些逻辑处理
*/
public initData():void {
super.initData();
this.onTouchRegresh(null);
}

public static refresh():void {
if (DebugWin._instance && DebugWin._instance.parent) {
DebugWin._instance._textInfo.text = Debug.log;
DebugWin._instance._textInfo.height = DebugWin._instance._textInfo.textHeight;
DebugWin._instance._textInfo.y = DebugWin._instance.height - DebugWin._instance._topContainer.height - DebugWin._instance._bottomContainer.height - DebugWin._instance._textInfo.textHeight
//DebugWin._instance._textInfo.scrollV = DebugWin._instance._textInfo.textHeight;
}
}
/**
* 隐藏
*/
public static hidden():void {
if (DebugWin._instance && DebugWin._instance.parent) {
DebugWin._instance.parent.removeChild(this._instance);
}
}
}
}

+ 57
- 0
src/org/easygame/component/DefaultGuideWin.ts View File

@@ -0,0 +1,57 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {

export class DefaultGuideWin extends Win{
public constructor(){
super();
}

/**
* 创建对象
*/
public createChildren():void {
super.createChildren();
}

public get guideItem():GuideItem{
if (this._data) return this._data;
return null;
}
/**
* 进入的逻辑
* 可以再次根据外部数据情况做一些逻辑处理
*/
public enter():void {
if (this.guideItem){
this.x += this.guideItem.oxWin;
this.y += this.guideItem.oyWin;
}
super.enter();
}
}
}

+ 77
- 0
src/org/easygame/component/DefaultLoadingView.ts View File

@@ -0,0 +1,77 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
export class DefaultLoadingView extends LoadingBaseUI {

private _gridWidth:number = 256;
private _gridHeight:number = 256;

private _bmpLogo:egret.Bitmap = null;//logo

public constructor() {
super();
}
public createChildren():void {
super.createChildren();
this.showBg = false;
this.setSize(this._gridWidth, this._gridHeight);

this._bmpLogo = new egret.Bitmap();
this.addChild(this._bmpLogo);
this._bmpLogo.texture = RES.getRes("loading_view");
this._bmpLogo.anchorOffsetX = this._bmpLogo.width * 0.5;
this._bmpLogo.anchorOffsetY = this._bmpLogo.height * 0.5;
this._bmpLogo.x = this.cx;
this._bmpLogo.y = this.cy;
}
/**
* 根据waitview的ui数据,进行下载控制
*/
public enter():void {
super.enter();
this._bmpLogo.rotation = 0;
this.alpha = 0;
//显示loading图像
HeartBeat.addListener(this, this.onShowLoadingGraphics);
}
/**
* 完成下载,回调加载view
*/
public outer():void {
super.outer();
//console.log("@@LoadingViewUI outer")
HeartBeat.removeListener(this, this.onShowLoadingGraphics);
}
/**
* 显示下载进度的图形
*/
public onShowLoadingGraphics():void {
if (this.alpha < 1) this.alpha += 0.1;
this._bmpLogo.rotation += 3;
}
}
}

+ 131
- 0
src/org/easygame/component/DefaultRenderer.ts View File

@@ -0,0 +1,131 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {

export class DefaultRenderer extends Group{
/**
* 对应的ui展现
*/
public _ui:BaseGroup = null;
/**
* ui资源已准备好
* @type {boolean}
* @private
*/
public _uiResReady:boolean = false;

public _selected:boolean;
/**
* item render所在的list
* @type {null}
*/
public list:List = null;

public constructor(){
super();
}
public createChildren():void{
super.createChildren();
this.setSize(100, 65);
}
/**
* 设置数据
*/
public set data(value:any){
this._data = value;
this.invalidate();
}
public get data():any{
return this._data;
}
/**
* 刷新
*/
public refresh():void {
this.data = this._data;
}

/**
* 设置选中
*/
public set selected(value:boolean){
this.setSelected(value);
}
public setSelected(value:boolean){
if (this._selected != value) {
this._selected = value;
this.invalidate();
}
}
public get selected():boolean{
return this._selected;
}
/**
* 获取ui层的显示对象
* @returns {egret.Sprite}
*/
public getUI():any {
return this._ui;
}
/**
* 设置ui层的显示对象
* @param myui
*/
public setUI(myui:BaseGroup) {
this._ui = myui;
//console.log("!!!view set ui!! 000 this._ui=" + egret.getQualifiedClassName(this._ui));
if (this._ui) {
this.addChild(this._ui);
this.setSize(this._ui.width, this._ui.height);
//console.log("!!!view set ui!! 1111 this._ui=" + egret.getQualifiedClassName(this._ui));
}
this.showBg = false;
}
/**
* 做ui的销毁
* 一般情况下,需要手动调用销毁
*/
public destroy():void {
if (this._ui){
//if (this._ui.hasOwnProperty("destroy"))this._ui.destroy();
this._ui = null;
}
}
/**
* 首次材质下载完成会调用加载一次,刷新UI皮肤显示
* 使用了框架的UI机制,单ui的资源下载完成会调用改方法刷新
* 若view中有逻辑使用到ui的素材,应该在这里做素材的赋值
*/
public validateNow():void{
//console.log("clz=" + egret.getQualifiedClassName(this) + ", validateNow!!")
if (this._ui && this._ui["validateNow"]) this._ui["validateNow"]();
this.drawDelay = false;
if (this._ui)this._ui.drawDelay = false;
}
}
}

+ 278
- 0
src/org/easygame/component/LoadingBaseUI.ts View File

@@ -0,0 +1,278 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
export class LoadingBaseUI extends Group {
/**
* 对应的ui展现
*/
public _ui:BaseGroup = null;
/**
* ui资源已准备好
* @type {boolean}
* @private
*/
public _uiResReady:boolean = false;

//下载的资源是否完成
public _viewResDowloaded:boolean = false;
public showLoading:boolean = true;

public constructor(drawDelay:boolean = false) {
super(drawDelay);
}

public createChildren():void {
super.createChildren();
this.showBg = false;
}

/**
* 初始化一些必要的逻辑数据
* 这个方法是在第一次加入stage的时候,做调用
*/
public initData():void {
this.validateNow();
}

/**
* 进度的展示
* @param current
* @param total
*/
public setProgress(current, total):void {
//this.textField.text = "加载中..." + current + "/" + total;
}

/**
* 根据waitview的ui数据,进行下载控制
* silent:静默下载,不显示loading图标
*/
public enter():void {
if (!this.parent) {
if (ViewManager.mainContainer) {
ViewManager.mainContainer.addChild(this);
} else {
GlobalSetting.STAGE.addChild(this);
}
}
this.visible = this.showLoading;
this.enterTransition();
this._viewResDowloaded = false;
if (this._resUIFileArr)this._resUIFileArr.length = 0;
if (this._resUIGroup)this._resUIGroup.length = 0;
//居中显示
if (this.parent) {
this.x = easy.GlobalSetting.DISPLAY_WIDTH / 2 - this.cx;
this.y = easy.GlobalSetting.DISPLAY_HEIGHT / 2 - this.cy;
}
//开始下载资源
if (this._data){
//Debug.log = "LoadingBaseUI enter data=" + egret.getQualifiedClassName(this._data) + ", showLoading=" + this.showLoading;
this.fireUIDownloading();
} else {
//Debug.log = "LoadingBaseUI enter data=null" + ", showLoading=" + this.showLoading;
}
}
/**
* enter的过渡效果
*/
public enterTransition():void {
this.alpha = 0;
egret.Tween.get(this).to({alpha:1}, 500).call(this.enterTransitionComplete, this);
}
/**
* enter的过渡效果结束
*/
public enterTransitionComplete():void {
}
/**
* 完成下载,回调加载view
*/
public outer():void {
//console.log("@@LoadingBaseUI outer!")
this.outerTransition();
}

/**
* outer的过渡效果
*/
public outerTransition():void {
egret.Tween.get(this).to({alpha:0.5}, 300).call(this.outerTransitionComplete, this).to({alpha:0}, 200);
}
/**
* outer的过渡效果结束
*/
public outerTransitionComplete():void {
if (this._data) {
//Debug.log = "LoadingBaseUI hasCode=" + this.hashCode + ", outerTransitionComplete data=" + egret.getQualifiedClassName(this._data);
if (this._data instanceof View) {
ViewManager.waitViewDoEnter();
} else if (this._data instanceof Win) {
PopupManager.waitWinDoEnter();
}
}
this._data = null;
this.removeFromParent();
}


/**
* 获取ui层的显示对象
* @returns {egret.Sprite}
*/
public getUI():any {
return this._ui;
}

/**
* 设置ui层的显示对象
* @param myui
*/
public setUI(myui:BaseGroup) {
this._ui = myui;
//console.log("!!!view set ui!! 000 this._ui=" + egret.getQualifiedClassName(this._ui));
if (this._ui) {
this.addChild(this._ui);
this.setSize(this._ui.width, this._ui.height);
//console.log("!!!view set ui!! 1111 this._ui=" + egret.getQualifiedClassName(this._ui));
}
this.showBg = false;
}

/**
* 首次材质下载完成会调用加载一次,刷新UI皮肤显示
* 使用了框架的UI机制,单ui的资源下载完成会调用改方法刷新
* 若view中有逻辑使用到ui的素材,应该在这里做素材的赋值
*/
public validateNow():void {
this.drawDelay = false;
//console.log("clz=" + egret.getQualifiedClassName(this) + ", validateNow!!")
if (this._ui && this._ui["validateNow"]) this._ui["validateNow"]();
if (this._ui)this._ui.drawDelay = false;
this.resetPosition();
for (var i:number = 0; i < this.numChildren; i++) {
if (this.getChildAt(i) instanceof BaseGroup)(<BaseGroup><any> (this.getChildAt(i))).resetPosition();
}
}

/********************** win view下载 设置***********************/
private _resUIFileArr:Array<string> = null;//
private _resUIGroup:Array<string> = null;
private _progressCalculate:ProgressCalculate = null;

/**
* 开始下载ui资源
*/
public fireUIDownloading():boolean {
//easy.Debug.log = "@UI fireUIDownloading 000 current.ui=" + egret.getQualifiedClassName(this._data._ui);
if (this._data && this._data._ui && this._data._ui.hasOwnProperty("resSpriteSheet") && this._data._ui.hasOwnProperty("resFiles")) {
//easy.Debug.log = "@UI fireUIDownloading 111 current.ui=" + egret.getQualifiedClassName(this._data._ui);
//loader文件,个数下载
this._resUIFileArr = [].concat(this._data._ui["resFiles"]);
if (this._resUIFileArr && this._resUIFileArr.length > 0) {
//easy.Debug.log = "@UI fireUIDownloading 2222";
if (this._data._ui.hasOwnProperty("resGroup")) {
//easy.Debug.log = "@UI fireUIDownloading 333";
this._resUIGroup = [].concat(this._data._ui["resGroup"]);
var allLoaded:boolean = true;
for (var i = 0; i < this._resUIGroup.length; i++) {
if (!RES.isGroupLoaded(this._resUIGroup[i])) {
allLoaded = false;
//easy.Debug.log = "@UI fireUIDownloading 444";
break;
}
}
if (allLoaded) {
//easy.Debug.log = "@UI fireUIDownloading 555";
this._viewResDowloaded = true;
if (this._progressCalculate)this._progressCalculate.reset();
easy.HeartBeat.addListener(this, this.onHbProgress, 2);
//easy.Debug.log = "_viewResDowloaded=" + this._viewResDowloaded;
return;
}
}
//初始化Resource资源加载库
//easy.Debug.log = "@UI fireUIDownloading loadConfig=" + this._resUIFileArr;
ResManager.loadGroups(this._resUIGroup, this.onUIResourceLoadComplete, this, true);
for (var i:number = 0; i < this._resUIFileArr.length; i++) {
ResManager.loadConfig(easy.GlobalSetting.CDN_RES + "assets/ui/" + this._resUIFileArr[i])
}
//进度条模拟数据启动
if (this._progressCalculate)this._progressCalculate.reset();
easy.HeartBeat.addListener(this, this.onHbProgress, 2);
//easy.Debug.log = "@UI fireUIDownloading 6666";
return false;
}
} else {
this._viewResDowloaded = true;
if (this._progressCalculate)this._progressCalculate.reset();
easy.HeartBeat.addListener(this, this.onHbProgress, 2);
}
//easy.Debug.log = "@UI.no ui file loading!!";
return true;
}

/**
* 资源组加载完成
*/
private onUIResourceLoadComplete(event:RES.ResourceEvent):void {
//easy.Debug.log = "@UI.res.group.down 111";
var allLoaded:boolean = true;
for (var i = 0; i < this._resUIGroup.length; i++) {
if (!RES.isGroupLoaded(this._resUIGroup[i])) {
allLoaded = false;
//easy.Debug.log = "@UI.res.group.down 222="+this._resUIGroup[i];
break;
}
}
if (allLoaded) {
this._resUIGroup.length = 0;
this._resUIFileArr.length = 0;
//try{
// if (this._data && this._data.hasOwnProperty("_uiResReady")) this._data["_uiResReady"] = true;
//} catch (e){
//}
//全部下载完成
this._viewResDowloaded = true;
//easy.Debug.log = "@UI.res.group.down 333";
}
}

private onHbProgress():void {
if (this._progressCalculate == null) this._progressCalculate = new easy.ProgressCalculate();
if (this._viewResDowloaded) this._progressCalculate._progressSpeedUp = this._viewResDowloaded;
var progress:number = this._progressCalculate.progress();
//easy.Debug.log = "progress=" + progress + ", hasCode=" + this.hashCode + ", this._viewResDowloaded=" + this._viewResDowloaded + ", data=" + egret.getQualifiedClassName(this._data);
this.setProgress(progress, 100);
if (progress >= 100) {
if (this._data && this._data["validateNow"]) this._data["validateNow"]();
easy.HeartBeat.removeListener(this, this.onHbProgress);
this.outer();
}
}
}
}

+ 140
- 0
src/org/easygame/component/MessageTips.ts View File

@@ -0,0 +1,140 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
/**
* 一个文字提示显示
*/
export class MessageTips extends BaseGroup {
private static _instance:MessageTips = null;//
private _dulation:number = 15;//停留时间
private _mssageArr:Array<any> = [];//消息内容
private speed:number = 5;//文字移动的速度

private _labelArr:Array<any> = [];//当前正在显示的label

private _showNext:boolean = false;//可以显示下一条

public constructor() {
super();
}
public static getInstance():MessageTips{
if (MessageTips._instance == null) MessageTips._instance = new MessageTips();
return MessageTips._instance;
}

/**
* 显示弹出的文字内容
* @param msg
*/
public static showMessage(msg:string, delay:number = 0, color:number = 0xfff666, x:number = 65535, y:number= 65535,speed:number = 5):void {
MessageTips.getInstance().showMsg(msg, delay, color, x, y, speed);
}

/**
* 显示message提示信息
* @param msg
* @param color
*/
public showMsg(msg:string, delay:number = 0, color:number = 0xfff666, x:number = 65535, y:number= 65535,speed:number = 5):void {
HeartBeat.addListener(this, this.onHeartBeat);
if (this._labelArr.length == 0) this._showNext = true;
this._mssageArr.push({msg:msg, color:color, x:x, y:y, delay:delay, speed:speed});
}
/**
* 呼吸计算位移
*/
private onHeartBeat():void {
if (this._labelArr.length == 0 && this._mssageArr.length == 0) {
HeartBeat.removeListener(this, this.onHeartBeat);
return;
}
var label:Label = null;
if(this._showNext && this._mssageArr.length > 0){//新文字,加入上浮
var item:Object = this._mssageArr.shift();
label =ObjectPool.getByClass(Label, "msgtips");//从缓存中拿一个label
label.text = item["msg"];
label.color = item["color"];
label.bold = true;
//label.stroke = 1;
//label.strokeColor = 0x000000;
label.alpha = 0;
label.fontSize = 40;
label.showBg = false;
label.autoSize = true;
if (item["delay"] > 0) {
label.setData(-item["delay"]);//计数停留时间帧
} else {
label.setData(0);//计数停留时间帧
}
easy.GlobalSetting.STAGE.addChild(label);
label.draw();
if (item["x"] == 65535){
label.x = GlobalSetting.DISPLAY_WIDTH/2 - label.cx;
} else {
label.x = item["x"];
}
if (item["y"] == 65535){
label.y = GlobalSetting.DISPLAY_HEIGHT/2;
} else {
label.y = item["y"];
}
this._labelArr.push({label:label,speed:item["speed"]});
//console.log("x=" + label._x + ", y=" + label._y + ", ix=" + item["x"] + ",iy=" + item["y"])
}
for (var i = 0; i< this._labelArr.length; i++){
item = this._labelArr[i];
label = item["label"];
if (label.getData() < 0) {
label.setData(label.getData() + 1);
continue;
}
//if (label._y == ViewManager.currentView.cy/2 && label.getData() < this._dulation) {//停留
// label.setData(label.getData() + 1);
//} else {
if (label.getData() < this._dulation) {
label.y -= item["speed"];
label.alpha += 0.1;
} else {
label.y -= (item["speed"] + 3);
label.alpha -= 0.1;
}
//}
if (label.y < 0){//回收
this._labelArr.splice(i,1);
label.removeFromParent();
ObjectPool.recycleClass(label, "msgtips");
}
var sp:egret.DisplayObject = ViewManager.currentView;
if (sp == null) sp = easy.GlobalSetting.STAGE;
if (i == (this._labelArr.length - 1) && (sp.height/2 - this._labelArr[i].y) > 5){
this._showNext = true;
}
}

}
}
}

+ 372
- 0
src/org/easygame/component/ReceiveGroup.ts View File

@@ -0,0 +1,372 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy{
/**
* view和win的基本类
* 定义了接收协议packet和event的能力,方便在已经展示的时候,通过packet和event的事件进行驱动刷新显示
*/
export class ReceiveGroup extends Group {
/**
* 消息和方法的映射关系表
*/
private METHOD_DEF:Object = {};
/**
* 对应的ui展现
*/
public _ui:BaseGroup = null;
/**
* ui资源已准备好
* @type {boolean}
* @private
*/
public _uiResReady:boolean = false;
public _isValidateNow:boolean = false;
public showLoading:boolean = true;
/**
* 强制刷新
* @type {boolean}
* @private
*/
public _forceValidateNow:boolean = false;
/**
* loding的class对象
* view是LoadingViewUI类
* win是LoadingWinUI类
* 这两个值分别在view和win子类中默认赋值
*/
public _loadingUIClz:any = null;
private _currentLoading:LoadingBaseUI = null;

public enterCompleted:boolean = false;//进入状态是否完成
/**
* 进入的效果
*/
private _enterEffect:IEffect = null;

public constructor() {
super(true);
this.initWeekListener();
}
/**
* 第一次加入场景的时候会运行该方法
*/
public onFirstAddToStage(event:Event):void {
super.onFirstAddToStage(event);
this.drawDelay = true;
}
/**
* 初始化弱监听方法,以便分发协议数据包用
* 不在监听列表的数据包,将被自动过滤掉
*/
public initWeekListener():void {
}
/**
* 添加事件的处理
* 注意:必须调用MessageControler.addEvent()注册事件名称,否者不会转发到这里
* 如果没有对应的的类型在此出现,则改Handle对Event事件到此为止,不再派发,防止造成事件死循环
* @param type MyEvent事件的类型
* @param func 对应的call back function,不包含onEvent前缀
*/
public addHandleEvent(eventType:string, funcName:string):void {
//console.log("ReceiveGroup this=" + egret.getQualifiedClassName(this) + ", addHandleEvent=" + type + ", funcName=" + funcName);
easy.MessageControler.addEvent(eventType)
this.METHOD_DEF[eventType] = funcName;
}

/**
* 添加协议处理的Handle,注意,functName的名称,前缀onPacket不包含
* @param msgId packet协议号
* @param func 对应的call back function,不包含onPacket前缀
*/
public addHandlePacket(msgId:number, funcName:string):void {
this.METHOD_DEF["" + msgId] = funcName;
}

/**
* 收到弱协议通知
* @param packet
*/
public receivePacket(packet:any):void {
if (this._ui){
//检测模板的receivePacket
for (var prop in this._ui){
if (prop.indexOf("$") == 0 || prop == "__class__" || prop == "hashCode" || prop == "__types__" || prop == "__proto__" || this._ui[prop] instanceof Function) continue;
if (this._ui[prop] instanceof Template && this._ui[prop] != this && this._ui[prop].parent){
this._ui[prop].receivePacket(packet);
}
}
}
if (this.METHOD_DEF["" + packet.header.messageId] && this[this.METHOD_DEF[packet.header.messageId]])this[this.METHOD_DEF["" + packet.header.messageId]].call(this, packet);
}

/**
* 收到界面弱事件通知
* @param event
*/
public receiveEvent(event:MyEvent):void {
//console.log("ReceiveGroup this=" + egret.getQualifiedClassName(this) + ", receiveEvent=" + event.type + ", isHas=" + this.METHOD_DEF[event.type]);
if (this._ui){
//检测模板的receiveEvent
for (var prop in this._ui){
if (prop.indexOf("$") == 0 || prop == "__class__" || prop == "hashCode" || prop == "__types__" || prop == "__proto__" || this._ui[prop] instanceof Function) continue;
if ((this._ui[prop] instanceof Template || this._ui[prop] instanceof List || this._ui[prop] instanceof ListAd) && this._ui[prop] != this && this._ui[prop].parent){
this._ui[prop].receiveEvent(event);
}
}
}
if (this.METHOD_DEF[event.type] && this[this.METHOD_DEF[event.type]]) this[this.METHOD_DEF[event.type]].call(this, event);
}
/**
* 初始化主场景的组件
* 这个方法在对象new的时候就调用,因为有些ui必须在加入stage之前就准备好
* 子类覆写该方法,添加UI逻辑
*/
public createChildren():void {
super.createChildren();
this.drawDelay = true;
this.touchEnabled = true;//默认不接受事件
this.showBg = false;
this.addHandleEvent(EventType.RESOURCE_DOWNLOADED, "onMyEventResDownloaded");
if (this._uiResReady && !this._isValidateNow) this.validateNow();
}
/**
* 进入的逻辑
* 可以再次根据外部数据情况做一些逻辑处理
*/
public enter():void {
if (this._currentLoading) {
//ObjectPool.recycleClass(this._currentLoading, "loading");
//this._currentLoading = null;
}
if (this._uiResReady && !this._isValidateNow) this.validateNow();
//console.log("@@enter=" + egret.getQualifiedClassName(this))
if (this._ui){
if (this._ui["enter"]) this._ui["enter"]();
//检测模板的enter
for (var prop in this._ui){
if (this._ui[prop] instanceof Template && this._ui[prop] != this && this._ui[prop].parent){
this._ui[prop].enter();
}
}
}
this.enterTransition();
}

/**
* enter的过渡效果
*/
public enterTransition():void {
//console.log("@@enterTransition=" + egret.getQualifiedClassName(this))
this.enterCompleted = false;
if (this._enterEffect){
this._enterEffect.play();
} else {
this.enterTransitionComplete();
}
}

/**
* enter的过渡效果结束
*/
public enterTransitionComplete():void {
//console.log("@@enterTransitionComplete=" + egret.getQualifiedClassName(this))
}

/**
* 退出的逻辑
* 做一些数据的销毁或者初始化,保证下次进入的时候,不会残留
*/
public outer():void {
//console.log("@@outer=" + egret.getQualifiedClassName(this))
if (this._ui){
if (this._ui["outer"]) this._ui["outer"]();
//检测模板的enter
for (var prop in this._ui){
if (this._ui[prop] instanceof Template && this._ui[prop] != this){
this._ui[prop].outer();
}
}
}
this.outerTransition();
}
/**
* outer的过渡效果
*/
public outerTransition():void {
//console.log("@@outerTransition=" + egret.getQualifiedClassName(this))
this.outerTransitionComplete();
}
/**
* outer的过渡效果结束
*/
public outerTransitionComplete():void {
//console.log("@@outerTransitionComplete=" + egret.getQualifiedClassName(this))
this.removeFromParent();
}
/**
* 获取ui层的显示对象
* @returns {egret.Sprite}
*/
public getUI():any {
return this._ui;
}
/**
* 设置ui层的显示对象
* @param myui
*/
public setUI(myui:BaseGroup) {
this._ui = myui;
//console.log("!!!view set ui!! 000 this._ui=" + egret.getQualifiedClassName(this._ui));
if (this._ui) {
this.addChild(this._ui);
this.setSize(this._ui.width, this._ui.height);
//console.log("!!!view set ui!! 1111 this._ui=" + egret.getQualifiedClassName(this._ui));
}
this.showBg = false;
}
/**
* 做ui的销毁
* 一般情况下,需要手动调用销毁
*/
public destroy():void {
if (this._ui){
//if (this._ui.hasOwnProperty("destroy"))this._ui.destroy();
this._ui = null;
}
}
/**
* 检测资源是否完成
* @returns {boolean}
*/
public checkResReady():boolean {
//检测ui的情况,自动启动loading加载
//console.log("checkResReady 000 this._ui=" + this._ui + ", resSpriteSheet=" + this._ui.hasOwnProperty("resSpriteSheet") + ", resFiles=" + this._ui.hasOwnProperty("resFiles"))
//console.log("checkResReady 000 this._ui=" + this._ui)
if (!this._uiResReady && this._ui && this._ui["resFiles"]){
//console.log("checkResReady 1111")
//easy.Debug.log ="checkResReady 1111";
if (this._ui["resSpriteSheet"] == "" && this._ui["resFiles"].length == 0) {
//easy.Debug.log ="checkResReady 2222";
this.validateNow();
return true;
} else {
if (this._loadingUIClz) {
//console.log("checkResReady 2222")
//easy.Debug.log ="checkResReady 3333";
this._currentLoading = ObjectPool.getByClass(this._loadingUIClz, "loading");
this._currentLoading._data = this;
this._currentLoading.showLoading = this.showLoading;
//启动加载
this._currentLoading.enter();
} else {
//easy.Debug.log ="checkResReady 66666";
return true;
}
}
//easy.Debug.log ="checkResReady 4444";
//console.log("checkResReady 4444")
return false;
} else {
//easy.Debug.log ="checkResReady 5555";
if (this._forceValidateNow) this.validateNow();
}
return true;
}

/**
* 首次材质下载完成会调用加载一次,刷新UI皮肤显示
* 使用了框架的UI机制,单ui的资源下载完成会调用改方法刷新
* 若view中有逻辑使用到ui的素材,应该在这里做素材的赋值
*/
public validateNow():void{
this.drawDelay = false;
this._isValidateNow = true;
//console.log("clz=" + egret.getQualifiedClassName(this) + ", validateNow!!")
if (this._ui && this._ui["validateNow"]) this._ui["validateNow"]();
if (this._ui)this._ui.drawDelay = false;
}

/********************** 闲时下载 设置***********************/
//闲时下载的数量记录
private _idleLoadedGroupCount:number = 0;
//已经进行闲时下载
private _isIdleDownload:boolean = false;
public idleDownload():void {
if (this._isIdleDownload) return;
if (!this._uiResReady && this._ui && this._ui.hasOwnProperty("resFiles") && this._ui["resFiles"].length > 0) {
this._idleLoadedGroupCount = 0;
this._isIdleDownload = true;
var resArr:Array<string> = this._ui["resFiles"];
for(var i:number = 0; i < resArr.length; i++){
ResManager.loadConfig(easy.GlobalSetting.CDN_RES + "assets/ui/" + resArr[i]);
}
if (this._ui.hasOwnProperty("resGroup") && this._ui["resGroup"].length > 0){
resArr = [].concat(this._ui["resGroup"]);
ResManager.loadGroups(resArr, this.onLoadingResourceGroupComplete, this);
}
} else {
this._uiResReady = true;
}
}

/**
* loading配置文件的加载完成
* @param event
*/
private onLoadingResourceGroupComplete(event:RES.ResourceEvent):void {
if (!this._uiResReady && this._ui && this._ui.hasOwnProperty("resGroup") && this._ui["resGroup"].length > 0){
var allLoaded:boolean = true;
for(var i = 0; i < this._ui["resGroup"].length; i++){
if (!RES.isGroupLoaded(this._ui["resGroup"][i])) {
allLoaded = false;
break;
}
}
if (allLoaded) {
//完成下载,标记
this._uiResReady = true;
this._forceValidateNow = true;
}
}
}

/**
* 舞台尺寸变化
*/
public onStageResize():void {
if (this._ui){
//检测模板的onStageResize
this.onInvalidatePosition();
for (var prop in this._ui){
if (this._ui[prop] instanceof Template && this._ui[prop] != this){
this._ui[prop].onStageResize();
}
}
}
}
}
}

+ 44
- 0
src/org/easygame/component/Template.ts View File

@@ -0,0 +1,44 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy{
/**
* view和win的基本类
* 定义了接收协议packet和event的能力,方便在已经展示的时候,通过packet和event的事件进行驱动刷新显示
*/
export class Template extends ReceiveGroup {
public constructor() {
super();
}
/**
* outer的过渡效果
*/
public outerTransition():void {
//super.outerTransition();//调用父类的话,就会被移除
//TODO 可以覆盖这里,写自己想要的out效果
}
}
}

+ 210
- 0
src/org/easygame/component/View.ts View File

@@ -0,0 +1,210 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy{
/**
* view的基本类
* 所有的ui组件都应该放置在ui层中
* 在view中只处理view相关的逻辑,对ui成层的组件进行操作
*/
export class View extends ReceiveGroup {
private _scene:easy.rpg.Scene = null;
public constructor() {
super();
this._loadingUIClz = ViewManager.defaultLoadingClass;
}

/**
* view进入的逻辑
* 可以再次根据外部数据情况做一些逻辑处理
*/
public enter():void {
super.enter();
var key:string = egret.getQualifiedClassName(this);
var myEvent:easy.MyEvent = easy.MyEvent.getEvent(easy.EventType.VIEW_ENTER);
myEvent.addItem("data", key);
myEvent.send();
if (this._scene){
this._scene.enter();
}
//检测尺寸
this.checkViewSize();
if (GlobalSetting.STATS_VIEW){
//统计代码
var stateutils = egret.getDefinitionByName("StatsUtil")
if (stateutils) stateutils["trackPageview"](egret.getQualifiedClassName(this));
}
}
/**
* view退出的逻辑
* 做一些数据的销毁或者初始化,保证下次进入的时候,不会残留
*/
public outer():void {
super.outer();
var key:string = egret.getQualifiedClassName(this);
var myEvent:easy.MyEvent = easy.MyEvent.getEvent(easy.EventType.VIEW_OUTER);
myEvent.addItem("data", key);
myEvent.send();
}
/**
* 设置ui层的显示对象
* @param myui
*/
public setUI(myui:BaseGroup) {
super.setUI(myui);
this._ui = myui;
if (this._ui) {
this.addChild(this._ui);
}
}
/**
* 检测view的尺寸要求是否达到设定
*/
public checkViewSize():void {
if (GlobalSetting.DISPLAY_MODEL == GlobalSetting.DISPLAY_VIEW_EASYGAME){
var w:number = this.width;
var h:number = this.height;
if (this._scene){
//console.log("check size has sence")
//有场景的,需要自适应窗口大小
if (this.scene.sceneWidth <= 0) {
w = GlobalSetting.STAGE_WIDTH;
} else if(GlobalSetting.STAGE_WIDTH < w){
if (GlobalSetting.STAGE_WIDTH >= GlobalSetting.VIEW_MINI_WIDTH) {
w = GlobalSetting.STAGE_WIDTH;
} else {
w = GlobalSetting.VIEW_MINI_WIDTH;
}
} else if (GlobalSetting.STAGE_WIDTH > this.scene.sceneWidth) {
w = this.scene.sceneWidth;
} else {
w = GlobalSetting.STAGE_WIDTH;
}
if (this.scene.sceneHeight <= 0) {
h = GlobalSetting.STAGE_HEIGHT;
if (!egret.NumberUtils.isNumber(h)) {
//console.log("checkViewSize2222 height is not a number!!!!");
}
} else if(GlobalSetting.STAGE_HEIGHT < h){
if (GlobalSetting.STAGE_HEIGHT >= GlobalSetting.VIEW_MINI_HEIGHT) {
h = GlobalSetting.STAGE_HEIGHT;
//console.log("checkViewSize333 height is not a number!!!!");
} else {
h = GlobalSetting.VIEW_MINI_HEIGHT;
//console.log("checkViewSize444 height is not a number!!!!");
}
} else if (GlobalSetting.STAGE_HEIGHT > this.scene.sceneHeight) {
h = this.scene.sceneHeight;
//console.log("checkViewSize555 height is not a number!!!! h=" + h);
} else {
h = GlobalSetting.STAGE_HEIGHT;
//console.log("checkViewSize666 height is not a number!!!!");
}
} else {//无场景的
//console.log("check size no sence")
if(GlobalSetting.STAGE_WIDTH > w){
if (GlobalSetting.STAGE_WIDTH >= GlobalSetting.VIEW_MINI_WIDTH) {
w = GlobalSetting.STAGE_WIDTH;
} else {
w = GlobalSetting.VIEW_MINI_WIDTH;
}
} else if (GlobalSetting.VIEW_MINI_WIDTH > w){
w = GlobalSetting.STAGE_WIDTH;
}
if(GlobalSetting.STAGE_HEIGHT > h){
if (GlobalSetting.STAGE_HEIGHT >= GlobalSetting.VIEW_MINI_HEIGHT) {
h = GlobalSetting.STAGE_HEIGHT;
} else {
h = GlobalSetting.VIEW_MINI_HEIGHT;
}
} else if (GlobalSetting.VIEW_MINI_HEIGHT > h){
h = GlobalSetting.STAGE_HEIGHT;
}
}
w = parseInt("" + w);
h = parseInt("" + h);
this.setSize(w, h);
var ui:BaseGroup = this.getUI();
if (ui){
ui.setSize(w, h);
}
if (this._scene)this._scene.setSize(w, h);
//console.log("view checkViewSize widht=" + w + ", height=" + h)
}
}
/**
* enter的过渡效果
*/
public enterTransition():void {
if (ViewManager.currentView && ViewManager.currentView != this) ViewManager.currentView.outer();
super.enterTransition();
}
/**
* enter的过渡效果结束
*/
public enterTransitionComplete():void {
if (ViewManager.currentView && ViewManager.currentView != this) ViewManager.currentView.outerTransitionComplete();
super.enterTransitionComplete();
ViewManager.currentView = this;
}

/**
* 设置场景
* @param scene
*/
public set scene(scene:easy.rpg.Scene){
if (this._scene){//旧场景移除
this._scene.removeFromParent();
}
this._scene = scene;
if (this._scene){
this.addChildAt(this._scene, 0);
}
this.checkViewSize();
}

public get scene():easy.rpg.Scene{
return this._scene;
}

/**
* 舞台尺寸变化
*/
public onStageResize():void {
if (GlobalSetting.DISPLAY_MODEL == GlobalSetting.DISPLAY_VIEW_EASYGAME) {
this.setSize(GlobalSetting.DISPLAY_WIDTH, GlobalSetting.DISPLAY_HEIGHT);
super.onStageResize();
this.checkViewSize();
//调整当前view的loading的位置
var loading:LoadingBaseUI = ObjectPool.getByClass(this._loadingUIClz, "loading", false);
if (loading && loading.parent){//loading 在显示中
loading.x = 0;
loading.y = 0;
}
}
}
}
}

+ 114
- 0
src/org/easygame/component/Win.ts View File

@@ -0,0 +1,114 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy{
/**
* win的基本类
* 所有的ui组件都应该放置在ui层中
* 在win中只处理view相关的逻辑,对ui成层的组件进行操作
*/
export class Win extends ReceiveGroup {
/**
* 进入的效果
*/
private _outerEffect:IEffect = null;
/**
* win成对应的ui展现
* @type {null}
* @private
*/
public constructor() {
super();
this._loadingUIClz = PopupManager.defaultLoadingClass;
}
public createChildren():void {
super.createChildren();
}
/**
* enter的过渡效果
*/
public enterTransition():void {
super.enterTransition();
}
/**
* enter的过渡效果结束
*/
public enterTransitionComplete():void {
super.enterTransitionComplete();
}
/**
* win进入的逻辑
* 可以再次根据外部数据情况做一些逻辑处理
*/
public enter():void {
super.enter();
var key:string = egret.getQualifiedClassName(this);
var myEvent:easy.MyEvent = easy.MyEvent.getEvent(easy.EventType.WIN_ENTER);
myEvent.addItem("data", key);
myEvent.send();

if (GlobalSetting.STATS_WIN){
//统计代码
var stateutils = egret.getDefinitionByName("StatsUtil")
if (stateutils) stateutils["trackPageview"](egret.getQualifiedClassName(this));
}
}

/**
* win退出的逻辑
* 做一些数据的销毁或者初始化,保证下次进入的时候,不会残留
*/
public outer():void {
super.outer();
var key:string = egret.getQualifiedClassName(this);
var myEvent:easy.MyEvent = easy.MyEvent.getEvent(easy.EventType.WIN_OUTER);
myEvent.addItem("data", key);
myEvent.send();
}

/**
* 舞台尺寸变化
*/
public onStageResize():void {
//super.onStageResize();
this.x = ViewManager.currentView.cx - this.cx;
this.y = ViewManager.currentView.cy - this.cy;
//调整当前view的loading的位置
var loading:LoadingBaseUI = ObjectPool.getByClass(this._loadingUIClz, "loadingwin", false);
if (loading && loading.parent){//loading 在显示中
loading.x = 0;
loading.y = 0;
}
}

/**
* 关闭窗口类
*/
public hiddent():void {
easy.PopupManager.hidden(this);
}
}
}

+ 55
- 0
src/org/easygame/component/effect/BaseEffect.ts View File

@@ -0,0 +1,55 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
export class BaseEffect implements IEffect{
public _outerTarget:ReceiveGroup = null;
public _enterTarget:ReceiveGroup = null;
public constructor() {
}

/**
* 准备数据,播放效果
*/
public play():void {
this._enterTarget = ViewManager._waitChangeView;
this._outerTarget = ViewManager.currentView;
if (this._enterTarget == this._outerTarget)this._outerTarget = null;
this.onPlayEffect();
}

public onPlayEffect():void {
if (this._outerTarget)this._outerTarget.outerTransition();
if (this._enterTarget)this._enterTarget.enterTransition();
}
public onEffectComplete():void {
if (this._outerTarget)this._outerTarget.outerTransitionComplete();
if (this._enterTarget)this._enterTarget.enterTransitionComplete();
this._outerTarget = null;
this._enterTarget = null;
}
}
}

+ 31
- 0
src/org/easygame/component/effect/IEffect.ts View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
export interface IEffect {
play():void;
}
}

+ 33
- 0
src/org/easygame/component/effect/RollerDown.ts View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
export class RollerDown extends BaseEffect{
public constructor() {
super();
}
}
}

+ 249
- 0
src/org/easygame/core/GlobalSetting.ts View File

@@ -0,0 +1,249 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
/**
* 这里记录全局公用的一些数据和设置
*/
export class GlobalSetting {
/**
* 在显示view的时候,按照设计的尺寸显示,不做view宽高的改变,采用egret自带的scale策略
*/
public static DISPLAY_VIEW_EGRET:string = "egret";
/**
* 在显示view的时候会自动把view页面设置成当前最大显示宽高
*/
public static DISPLAY_VIEW_EASYGAME:string = "easygame";
/**
* 显示模式设置
* @type {string}
*/
public static DISPLAY_MODEL:string = GlobalSetting.DISPLAY_VIEW_EGRET;
/**
* 开发模式开关
* 打开开发模式,logger会记录打印信息到debug窗口
* @type {boolean}
*/
public static DEV_MODEL:Boolean = true;//开发模式
/**
* 游戏系统的时间校对
* 一般登录完成后,服务器会通知一个当前的服务器时间
* 以此时间为基准,客户端可以随时校对自己的时间
* @type {number}
*/
public static SYSTEM_DATE:number = 0;
/**
* 声音总开关
* @type {boolean}
*/
public static VOLUME_OPEN:boolean = true;//音量开关
/**
* 帧频设置
* @type {number}
*/
public static FRAME_RATE:number = 60;//帧频
/**
* 舞台
* @type {null}
*/
public static STAGE:egret.Stage = null;//舞台
//public static IOS:Boolean = false;//是否ios设备
/**
* 舞台的宽
* @type {number}
*/
public static STAGE_WIDTH:number = 480;//实际舞台宽
/**
* 舞台的高
* @type {number}
*/
public static STAGE_HEIGHT:number = 800;//实际舞台高
/**
* 显示的宽
* @type {number}
*/
public static DISPLAY_WIDTH:number = 480;
/**
* 显示的高
* @type {number}
*/
public static DISPLAY_HEIGHT:number = 800;
/**
* 最小view的宽
* @type {number}
*/
public static VIEW_MINI_WIDTH:number = 300;//最小view宽
/**
* 最小view的高
* @type {number}
*/
public static VIEW_MINI_HEIGHT:number = 300;//最小view高
/**
* 最大加载数量
* @type {number}
*/
public static LOADING_THREAD_MAX:number = 5;
/**
* 检测空闲下载的间隔时间,单位:秒
* @type {number}
*/
public static CHECK_IDLE_LOADING:number = 15;
/**
* 开关
* 进行报表统计
* @type {null}
*/
public static REPORT:boolean = false;
/**
* 开关
* 对UI的可点击对象进行报表统计
* @type {null}
*/
public static REPORT_UI:boolean = false;
//报表URL地址
public static REPORT_URL:string = "";
//产品名
public static APP_NAME:string = "";
//产品id
public static APP_PRODUCT:string = "";
/**
* 设备信息, 报表使用
*/
public static APP_DEVICE:string = "";
public static APP_RATE:number = 0;
public static APP_RATE_NAME:number = 0;
/**
* 渠道信息, 报表使用
*/
public static APP_CHANNEL:string = "";
/**
* 版本信息, 报表使用
*/
public static APP_VERSION:string = "";
/**
* 使用的渠道, 报表使用
*/
public static APP_PROVIDE:number = 0;
/**
* app存取数据的方式
*/
public static APP_STORAGE:string = "local";//local:本地, net:网络, local_net:混合模式
//存储方式的常量设定
public static STORAGE_LOCAL:string = "local";//本地存储方式
public static STORAGE_NET:string = "net";//网络存储方式
public static STORAGE_LOCAL_NET:string = "local_net";//本地和网络混合存储方式
/**
* runtime环境
*/
public static RUNTIME:string = "web";
public static RUNTIME_WEB:string = "web";
public static RUNTIME_NATIVE:string = "native";
/**
* 统计
*/
public static STATS_VIEW:boolean = false;//VIEW 统计
public static STATS_WIN:boolean = false;//WIN 统计
public static STATS_BTN:boolean = false;//BTN 统计
public static STATS_MC:boolean = false;//MC 统计
public static STATS_LIST:boolean = false;//LIST 统计
/**
* CDN资源位置
*/
public static CDN_RES:string = "resource/";

/**
* 初始化全局的数据
*/
public static initData():void{
GlobalSetting.RUNTIME = egret.Capabilities.runtimeType;
GlobalSetting.STAGE = egret.MainContext.instance.stage;
//Debug.log = "计算正常帧时=" + HeartBeat._eplasedTime;

//console.log("uuid=" + GlobalSetting.APP_DEVICE);
Debug.log = "---- GlobalSetting init ----";
Debug.log = "runtimeType=" + egret.Capabilities.runtimeType + ", deviceType=" + egret.MainContext.deviceType;
Debug.log = "RUNTIME=" + GlobalSetting.RUNTIME;

//尺寸初始化
GlobalSetting.initInfoSize();
}

/**
* 初始化舞台尺寸
*/
public static initInfoSize():void {
console.log("stage resize w=" + GlobalSetting.STAGE.stageWidth + ", h=" + GlobalSetting.STAGE.stageHeight);
GlobalSetting.STAGE_WIDTH = GlobalSetting.STAGE.stageWidth;
GlobalSetting.STAGE_HEIGHT = GlobalSetting.STAGE.stageHeight;

//var sizeInfo:egret.sys.StageDisplaySize = egret.sys.screenAdapter.calculateStageSize();
GlobalSetting.DISPLAY_WIDTH = GlobalSetting.STAGE_WIDTH;
GlobalSetting.DISPLAY_HEIGHT = GlobalSetting.STAGE_HEIGHT;

if (GlobalSetting.DEV_MODEL) {
Debug.log = "---- GlobalSetting Info Size ----";
Debug.log = "STAGE_WIDTH=" + GlobalSetting.STAGE_WIDTH + ", STAGE_HEIGHT=" + GlobalSetting.STAGE_HEIGHT;
//Debug.log = "DISPLAY_WIDTH=" + GlobalSetting.DISPLAY_WIDTH + ", DISPLAY_HEIGHT=" + GlobalSetting.DISPLAY_HEIGHT;
}
}
/**
* 是否native运行
*/
public static isNative():boolean{
return GlobalSetting.RUNTIME == GlobalSetting.RUNTIME_NATIVE;
}

/**
* 判断是不是微信
* @returns {boolean}
*/
public isWeiXin():boolean {
var ua:string = navigator.userAgent.toString();
var str:any = ua.match(/MicroMessenger/i);
if (str == "MicroMessenger") {
return true;
} else {
return false;
}
//var bet = 1;//iphone系列比较特殊,尺寸需要翻倍
//switch (wid) {
// case 320://iphone4\5
// bet = 2;
// break;
// case 375://iphone 6
// bet = 2;
// break;
// case 414://iphone 6+
// bet = 3;
// break;
// default:
// bet = 1;
// break;
//}
//wid *= bet; hei *= bet;
}
}
}

+ 273
- 0
src/org/easygame/core/HeartBeat.ts View File

@@ -0,0 +1,273 @@
/**
* Copyright (c) 2014,www.easygame.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the easygame.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EASYEGRET.COM AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL EGRET-LABS.ORG AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module easy {
/**
* 方便便捷的监听utils
* 它的计时单位是帧
*/

export class HeartBeat {
//private static _halfRate:number = 0;
//private static _intervalTime:number = 0;
//private static _deltaTime:number = 0;
private static _listeners:Array<BeatItem> = new Array<BeatItem>();//{func:方法, count:频率, index:计数, loop:循环次数 -1:无限循环, loopcount:已call计数}
private static _functionCallList:Array<BeatItem> = new Array<BeatItem>();//;需要进行调用的方法列表
private static _MAX_EXECUTE_COUNT:number = 20;//每帧执行的个数
private static isInit:boolean = false;

private static _lastTime:number = 0;//最后一帧的时间,如果为
public static _eplasedTime:number = 0;//正常帧时间
private static _cumulativeTime:number = 0;//累积的丢失的帧时间

private static nowTime:number = 0;
private static realFrame:number = 0;//上一帧的实际帧频
private static item:BeatItem = null;
private static endCall:boolean = false;
//private static delVector:Array<HeartBeatItem> = null;
//private static functionCallItem:HearBeatFunctionCallItem = null;
/**
* 采用通用的补帧补偿机制
*/
private static onEnterFrame(event:Event):void {
var i:number = 0;
var j:number = 0;
var lenght:number = 0;
var item:BeatItem = null;
//计算补帧次数
var runNum:number = 1;
//if (HeartBeat._eplasedTime == 0) {
// HeartBeat._eplasedTime = 1000/GlobalSetting.FRAME_RATE;
//}
if (HeartBeat._lastTime > 0 && HeartBeat._eplasedTime > 0) {
//Debug.log = "正常帧时:" + HeartBeat._eplasedTime + ", 累积=" + HeartBeat._cumulativeTime;
//当前帧频
var timeNum:number = Math.floor((egret.getTimer() - HeartBeat._lastTime)-HeartBeat._eplasedTime);
//Debug.log = "正常帧时:" + HeartBeat._eplasedTime + ", 当前=" + timeNum;
if (timeNum > 0) {//帧时间丢失,累积起来,达到整帧就补
HeartBeat._cumulativeTime += timeNum;
if (HeartBeat._cumulativeTime > HeartBeat._eplasedTime){//可以补帧了
runNum += Math.floor(HeartBeat._cumulativeTime/HeartBeat._eplasedTime);
HeartBeat._cumulativeTime = HeartBeat._cumulativeTime%HeartBeat._eplasedTime;
//Debug.log = "补帧:" + runNum;
}
}
}
//检索并整理数据
for (var k:number = 0; k < runNum; k++) {
lenght = HeartBeat._listeners.length - 1;
for (i = lenght; i >= 0; i--) {
item = HeartBeat._listeners[i];
item.index++;
if (item.del) {//上一帧已标记要要删除,本帧删除之
//console.log("HeartBeat Del Func=" + item.func + ", clz=" + egret.getQualifiedClassName(item.thisArg));
HeartBeat._listeners.splice(i, 1);
ObjectPool.recycleClass(item)
continue;
}
if (item.count <= 1 || item.index % item.count == 0) {
item.loopcount++;
if (item.loop > 0 && item.loop <= item.loopcount) {
item.del = true;
}
//加入call的列表中
HeartBeat._functionCallList.unshift(item);
}
}
}
//执行
lenght = HeartBeat._functionCallList.length;
//lenght = lenght > HeartBeat._MAX_EXECUTE_COUNT ? HeartBeat._MAX_EXECUTE_COUNT : lenght;
for (i = 0; i < lenght; i++) {
item = HeartBeat._functionCallList.pop();
//判断func的参数情况
//console.log("1111111")
if (item.param && item.param.length > 0) {
//console.log("222222")
//显式定义参数,直接用指定参数返回
item.func.apply(item.thisArg, item.param);
} else {//无指定参数
//console.log("333333 arguments=" + item.func.length)
if (item.func.length == 0) {//无参数要求
item.func.call(item.thisArg);
} else {//func有参数,参数boolean返回true代表最后一次call, 参数number表示第几次调用
//console.log("heatbeat=" + typeof(item.func.arguments[0]))
//if (item.func.arguments[0] instanceof boolean) {
item.func.call(item.thisArg, item.del);
//} else if (item.func.arguments[0] instanceof number) {
// item.func.call(item.thisArg, item.loopcount);
//} else {
// item.func.call(item.thisArg, null);
//}
}
}
}
if (HeartBeat._listeners.length == 0) GlobalSetting.STAGE.removeEventListener(egret.Event.ENTER_FRAME, HeartBeat.onEnterFrame, HeartBeat);
HeartBeat._lastTime = egret.getTimer();//当前时间记录
}

/**
* 添加呼吸监听
* @param thisArg 方法的this宿主
* @param respone call back 的方法
* @param heartRrate 心率, 从加入开始计算,当达到frameCount的值时,进行一次func call
* @param repeat 要循环 call func 的次数
* @param params 回传的参数值
* @param nowExecute 立即执行
*/
public static addListener(thisArg:any, respone:Function, heartRrate:number = 1, repeat:number = -1, delay:number = 0, params:Array<any> = null, nowExecute:boolean = false):boolean {
if (respone == null || HeartBeat.isContainerListener(thisArg, respone)) return false;//同一个func防止重复添加
//console.log("HeartBeat ADD Func=" + respone + ", clz=" + egret.getQualifiedClassName(thisArg));
var item:BeatItem = ObjectPool.getByClass(BeatItem);
//if (GlobalSetting.DEV_MODEL) item.traceMsg = new Error().getStackTrace();//调试信息追踪
item.setData(thisArg, respone, heartRrate, repeat, delay, params);
HeartBeat._listeners.push(item);
if (nowExecute) {
item.loopcount ++;
if (item.param && item.param.length > 0) {
//console.log("222222")
//显式定义参数,直接用指定参数返回
item.func.apply(item.thisArg, item.param);
} else {//无指定参数
//console.log("333333 arguments=" + item.func.length)
if (item.func.length == 0) {//无参数要求
item.func.call(item.thisArg);
} else {//func有参数,参数boolean返回true代表最后一次call, 参数number表示第几次调用
//console.log("heatbeat=" + typeof(item.func.arguments[0]))
//if (item.func.arguments[0] instanceof boolean) {
item.func.call(item.thisArg, item.del);
//} else if (item.func.arguments[0] instanceof number) {
// item.func.call(item.thisArg, item.loopcount);
//} else {
// item.func.call(item.thisArg, null);
//}
}
}
}
HeartBeat._lastTime = egret.getTimer();
GlobalSetting.STAGE.addEventListener(egret.Event.ENTER_FRAME, HeartBeat.onEnterFrame, HeartBeat);
return true;
}

/**
* 移除呼吸
* @param thisArg 方法的this宿主
* @param respone
*/
public static removeListener(thisArg:any, respone:Function):void {
var i:number = 0;
for (i = 0; i < HeartBeat._listeners.length; i++) {
if (HeartBeat._listeners[i].func == respone && HeartBeat._listeners[i].thisArg == thisArg) {
HeartBeat._listeners[i].del = true;
break;
}
}
}

/**
* 呼吸中是否包含指定的回调func
* @param thisArg 方法的this宿主
* @param respone
* @return
*/
public static isContainerListener(thisArg:any, respone:Function):boolean {
var i:number = 0;
for (i = 0; i < HeartBeat._listeners.length; i++) {
if (HeartBeat._listeners[i].thisArg == thisArg && HeartBeat._listeners[i].func == respone && !HeartBeat._listeners[i].del) {
return true;
}
}
return false;
}

/**
* 当前呼吸内容长度
* @return
*/
public static getHearBeatLenght():number {
return HeartBeat._listeners.length;
}

/**
* 打印输出方法的追踪信息以及活动状态
* @return
*/
public static getHearBeatTrace():string {
var i:number = 0;
var msg:string = "";
var item:BeatItem = null;
msg += "总数:" + HeartBeat._listeners.length + "\n";
msg += "========================================================\n";
for (i = 0; i < HeartBeat._listeners.length; i++) {
item = HeartBeat._listeners[i];
if (item) {
msg += "基本信息 (" + i + "): ";
msg += "del=" + item.del + ", count=" + item.count + ", index=" + item.index + ", loop=" + item.loop + ", loopCount=" + item.loopcount + "\n";
//msg += "追踪信息:\n";
//if (StringUtil.isUsage(item.traceMsg))msg += item.traceMsg.substring(item.traceMsg.indexOf("]") + 2, item.traceMsg.length) + "\n";
msg += "------------------------------------\n";
}
}
msg += "========================================================\n";
return msg;
}
}

class BeatItem {
//要回call的方法
public func:Function = null;
//方法的宿主
public thisArg:any = null;
//频率
public count:number = 0;
//当前计数频率
public index:number = 0;
//循环次数
public loop:number = 0;
//已经循环的次数
public loopcount:number = 0;
//延迟
public delay:number = 0;
//完成,删除标记
public del:boolean = false;
//trace信息追踪
public traceMsg:string = null;
//call back function的参数
public param:Array<any> = null;

public setData(thisArg:any, respone:Function, heartRrate:number, repeat:number, delay:number, params:Array<any>):void {
this.thisArg = thisArg;
this.func = respone;
this.count = heartRrate;
this.loop = repeat;
this.delay = delay;
this.index = 0;
this.loopcount = 0;
this.del = false;
this.param = params;
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save