Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔立强
db-game-template
Commits
17c44c38
Commit
17c44c38
authored
Oct 11, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6aa7b8e7
Changes
85
Show whitespace changes
Inline
Side-by-side
Showing
85 changed files
with
51 additions
and
36 deletions
+51
-36
参考图.jpg
design/参考图.jpg
+0
-0
01.png
design/木箱/01.png
+0
-0
02.png
design/木箱/02.png
+0
-0
03.png
design/木箱/03.png
+0
-0
04.png
design/木箱/04.png
+0
-0
05.png
design/木箱/05.png
+0
-0
06.png
design/木箱/06.png
+0
-0
07.png
design/木箱/07.png
+0
-0
08.png
design/木箱/08.png
+0
-0
09.png
design/木箱/09.png
+0
-0
10.png
design/木箱/10.png
+0
-0
11.png
design/木箱/11.png
+0
-0
01.png
design/渔网/01.png
+0
-0
02.png
design/渔网/02.png
+0
-0
03.png
design/渔网/03.png
+0
-0
04.png
design/渔网/04.png
+0
-0
05.png
design/渔网/05.png
+0
-0
06.png
design/渔网/06.png
+0
-0
07.png
design/渔网/07.png
+0
-0
08.png
design/渔网/08.png
+0
-0
09.png
design/渔网/09.png
+0
-0
10.png
design/渔网/10.png
+0
-0
01.png
design/硬币 /01.png
+0
-0
02.png
design/硬币 /02.png
+0
-0
03.png
design/硬币 /03.png
+0
-0
04.png
design/硬币 /04.png
+0
-0
05.png
design/硬币 /05.png
+0
-0
06.png
design/硬币 /06.png
+0
-0
07.png
design/硬币 /07.png
+0
-0
08.png
design/硬币 /08.png
+0
-0
09.png
design/硬币 /09.png
+0
-0
10.png
design/硬币 /10.png
+0
-0
11.png
design/硬币 /11.png
+0
-0
1.png
design/礼物/1.png
+0
-0
2.png
design/礼物/2.png
+0
-0
3.png
design/礼物/3.png
+0
-0
4.png
design/礼物/4.png
+0
-0
5.png
design/礼物/5.png
+0
-0
6.png
design/礼物/6.png
+0
-0
7.png
design/礼物/7.png
+0
-0
8.png
design/礼物/8.png
+0
-0
9.png
design/礼物/9.png
+0
-0
01.png
design/礼盒2/01.png
+0
-0
02.png
design/礼盒2/02.png
+0
-0
03.png
design/礼盒2/03.png
+0
-0
04.png
design/礼盒2/04.png
+0
-0
05.png
design/礼盒2/05.png
+0
-0
06.png
design/礼盒2/06.png
+0
-0
07.png
design/礼盒2/07.png
+0
-0
08.png
design/礼盒2/08.png
+0
-0
09.png
design/礼盒2/09.png
+0
-0
10.png
design/礼盒2/10.png
+0
-0
11.png
design/礼盒2/11.png
+0
-0
01.png
design/贵重/01.png
+0
-0
02.png
design/贵重/02.png
+0
-0
03.png
design/贵重/03.png
+0
-0
04.png
design/贵重/04.png
+0
-0
05.png
design/贵重/05.png
+0
-0
06.png
design/贵重/06.png
+0
-0
07.png
design/贵重/07.png
+0
-0
08.png
design/贵重/08.png
+0
-0
09.png
design/贵重/09.png
+0
-0
10.png
design/贵重/10.png
+0
-0
11.png
design/贵重/11.png
+0
-0
01.png
design/银/01.png
+0
-0
02.png
design/银/02.png
+0
-0
03.png
design/银/03.png
+0
-0
04.png
design/银/04.png
+0
-0
05.png
design/银/05.png
+0
-0
06.png
design/银/06.png
+0
-0
07.png
design/银/07.png
+0
-0
08.png
design/银/08.png
+0
-0
09.png
design/银/09.png
+0
-0
10.png
design/银/10.png
+0
-0
11.png
design/银/11.png
+0
-0
12.png
design/银/12.png
+0
-0
.DS_Store
egret/.DS_Store
+0
-0
index.html
egret/index.html
+7
-7
MainBase.ts
egret/libs/tl/MainBase.ts
+11
-2
net.json
egret/resource/assets/startScene/net.json
+10
-10
net.png
egret/resource/assets/startScene/net.png
+0
-0
default.res.json
egret/resource/default.res.json
+5
-0
config.ts
egret/scripts/config.ts
+1
-1
Monkey.ts
egret/src/startScene/Monkey.ts
+5
-7
Net.ts
egret/src/startScene/Net.ts
+12
-9
No files found.
egret/
design/参考图.jpg
→
design/参考图.jpg
View file @
17c44c38
File moved
egret/
design/木箱/01.png
→
design/木箱/01.png
View file @
17c44c38
File moved
egret/
design/木箱/02.png
→
design/木箱/02.png
View file @
17c44c38
File moved
egret/
design/木箱/03.png
→
design/木箱/03.png
View file @
17c44c38
File moved
egret/
design/木箱/04.png
→
design/木箱/04.png
View file @
17c44c38
File moved
egret/
design/木箱/05.png
→
design/木箱/05.png
View file @
17c44c38
File moved
egret/
design/木箱/06.png
→
design/木箱/06.png
View file @
17c44c38
File moved
egret/
design/木箱/07.png
→
design/木箱/07.png
View file @
17c44c38
File moved
egret/
design/木箱/08.png
→
design/木箱/08.png
View file @
17c44c38
File moved
egret/
design/木箱/09.png
→
design/木箱/09.png
View file @
17c44c38
File moved
egret/
design/木箱/10.png
→
design/木箱/10.png
View file @
17c44c38
File moved
egret/
design/木箱/11.png
→
design/木箱/11.png
View file @
17c44c38
File moved
egret/
design/渔网/01.png
→
design/渔网/01.png
View file @
17c44c38
File moved
egret/
design/渔网/02.png
→
design/渔网/02.png
View file @
17c44c38
File moved
egret/
design/渔网/03.png
→
design/渔网/03.png
View file @
17c44c38
File moved
egret/
design/渔网/04.png
→
design/渔网/04.png
View file @
17c44c38
File moved
egret/
design/渔网/05.png
→
design/渔网/05.png
View file @
17c44c38
File moved
egret/
design/渔网/06.png
→
design/渔网/06.png
View file @
17c44c38
File moved
egret/
design/渔网/07.png
→
design/渔网/07.png
View file @
17c44c38
File moved
egret/
design/渔网/08.png
→
design/渔网/08.png
View file @
17c44c38
File moved
egret/
design/渔网/09.png
→
design/渔网/09.png
View file @
17c44c38
File moved
egret/
design/渔网/10.png
→
design/渔网/10.png
View file @
17c44c38
File moved
egret/
design/硬币 /01.png
→
design/硬币 /01.png
View file @
17c44c38
File moved
egret/
design/硬币 /02.png
→
design/硬币 /02.png
View file @
17c44c38
File moved
egret/
design/硬币 /03.png
→
design/硬币 /03.png
View file @
17c44c38
File moved
egret/
design/硬币 /04.png
→
design/硬币 /04.png
View file @
17c44c38
File moved
egret/
design/硬币 /05.png
→
design/硬币 /05.png
View file @
17c44c38
File moved
egret/
design/硬币 /06.png
→
design/硬币 /06.png
View file @
17c44c38
File moved
egret/
design/硬币 /07.png
→
design/硬币 /07.png
View file @
17c44c38
File moved
egret/
design/硬币 /08.png
→
design/硬币 /08.png
View file @
17c44c38
File moved
egret/
design/硬币 /09.png
→
design/硬币 /09.png
View file @
17c44c38
File moved
egret/
design/硬币 /10.png
→
design/硬币 /10.png
View file @
17c44c38
File moved
egret/
design/硬币 /11.png
→
design/硬币 /11.png
View file @
17c44c38
File moved
egret/
design/礼物/1.png
→
design/礼物/1.png
View file @
17c44c38
File moved
egret/
design/礼物/2.png
→
design/礼物/2.png
View file @
17c44c38
File moved
egret/
design/礼物/3.png
→
design/礼物/3.png
View file @
17c44c38
File moved
egret/
design/礼物/4.png
→
design/礼物/4.png
View file @
17c44c38
File moved
egret/
design/礼物/5.png
→
design/礼物/5.png
View file @
17c44c38
File moved
egret/
design/礼物/6.png
→
design/礼物/6.png
View file @
17c44c38
File moved
egret/
design/礼物/7.png
→
design/礼物/7.png
View file @
17c44c38
File moved
egret/
design/礼物/8.png
→
design/礼物/8.png
View file @
17c44c38
File moved
egret/
design/礼物/9.png
→
design/礼物/9.png
View file @
17c44c38
File moved
egret/
design/礼盒2/01.png
→
design/礼盒2/01.png
View file @
17c44c38
File moved
egret/
design/礼盒2/02.png
→
design/礼盒2/02.png
View file @
17c44c38
File moved
egret/
design/礼盒2/03.png
→
design/礼盒2/03.png
View file @
17c44c38
File moved
egret/
design/礼盒2/04.png
→
design/礼盒2/04.png
View file @
17c44c38
File moved
egret/
design/礼盒2/05.png
→
design/礼盒2/05.png
View file @
17c44c38
File moved
egret/
design/礼盒2/06.png
→
design/礼盒2/06.png
View file @
17c44c38
File moved
egret/
design/礼盒2/07.png
→
design/礼盒2/07.png
View file @
17c44c38
File moved
egret/
design/礼盒2/08.png
→
design/礼盒2/08.png
View file @
17c44c38
File moved
egret/
design/礼盒2/09.png
→
design/礼盒2/09.png
View file @
17c44c38
File moved
egret/
design/礼盒2/10.png
→
design/礼盒2/10.png
View file @
17c44c38
File moved
egret/
design/礼盒2/11.png
→
design/礼盒2/11.png
View file @
17c44c38
File moved
egret/
design/贵重/01.png
→
design/贵重/01.png
View file @
17c44c38
File moved
egret/
design/贵重/02.png
→
design/贵重/02.png
View file @
17c44c38
File moved
egret/
design/贵重/03.png
→
design/贵重/03.png
View file @
17c44c38
File moved
egret/
design/贵重/04.png
→
design/贵重/04.png
View file @
17c44c38
File moved
egret/
design/贵重/05.png
→
design/贵重/05.png
View file @
17c44c38
File moved
egret/
design/贵重/06.png
→
design/贵重/06.png
View file @
17c44c38
File moved
egret/
design/贵重/07.png
→
design/贵重/07.png
View file @
17c44c38
File moved
egret/
design/贵重/08.png
→
design/贵重/08.png
View file @
17c44c38
File moved
egret/
design/贵重/09.png
→
design/贵重/09.png
View file @
17c44c38
File moved
egret/
design/贵重/10.png
→
design/贵重/10.png
View file @
17c44c38
File moved
egret/
design/贵重/11.png
→
design/贵重/11.png
View file @
17c44c38
File moved
egret/
design/银/01.png
→
design/银/01.png
View file @
17c44c38
File moved
egret/
design/银/02.png
→
design/银/02.png
View file @
17c44c38
File moved
egret/
design/银/03.png
→
design/银/03.png
View file @
17c44c38
File moved
egret/
design/银/04.png
→
design/银/04.png
View file @
17c44c38
File moved
egret/
design/银/05.png
→
design/银/05.png
View file @
17c44c38
File moved
egret/
design/银/06.png
→
design/银/06.png
View file @
17c44c38
File moved
egret/
design/银/07.png
→
design/银/07.png
View file @
17c44c38
File moved
egret/
design/银/08.png
→
design/银/08.png
View file @
17c44c38
File moved
egret/
design/银/09.png
→
design/银/09.png
View file @
17c44c38
File moved
egret/
design/银/10.png
→
design/银/10.png
View file @
17c44c38
File moved
egret/
design/银/11.png
→
design/银/11.png
View file @
17c44c38
File moved
egret/
design/银/12.png
→
design/银/12.png
View file @
17c44c38
File moved
egret/.DS_Store
View file @
17c44c38
No preview for this file type
egret/index.html
View file @
17c44c38
...
@@ -46,14 +46,14 @@
...
@@ -46,14 +46,14 @@
var
__monkeyHandSize__
=
50
;
var
__monkeyHandSize__
=
50
;
var
__boxMoveSpeed__
=
1.5
;
var
__boxMoveSpeed__
=
1.5
;
var
__boxmap__
=
{
var
__boxmap__
=
{
coin
:
{
award
:
0
,
skin
:
'
https://yun.duiba.com.cn/db_games/activity/fishing/1539244791/
resource/assets/startScene/coin.png'
},
coin
:
{
award
:
0
,
skin
:
'resource/assets/startScene/coin.png'
},
gift
:
{
award
:
0
,
skin
:
'
https://yun.duiba.com.cn/db_games/activity/fishing/1539244791/
resource/assets/startScene/gift.png'
},
gift
:
{
award
:
0
,
skin
:
'resource/assets/startScene/gift.png'
},
gift2
:
{
award
:
0
,
skin
:
'
https://yun.duiba.com.cn/db_games/activity/fishing/1539244791/
resource/assets/startScene/gift2.png'
},
gift2
:
{
award
:
0
,
skin
:
'resource/assets/startScene/gift2.png'
},
woodbox
:
{
award
:
1
,
skin
:
'
https://yun.duiba.com.cn/db_games/activity/fishing/1539244791/
resource/assets/startScene/woodbox.json'
,
offset
:
[
128
,
79
]
},
//木宝箱
woodbox
:
{
award
:
1
,
skin
:
'resource/assets/startScene/woodbox.json'
,
offset
:
[
128
,
79
]
},
//木宝箱
silverbox
:
{
award
:
3
,
skin
:
'
https://yun.duiba.com.cn/db_games/activity/fishing/1539244791/
resource/assets/startScene/silverbox.png'
},
//银宝箱
silverbox
:
{
award
:
3
,
skin
:
'resource/assets/startScene/silverbox.png'
},
//银宝箱
goldenbox
:
{
award
:
5
,
skin
:
'
https://yun.duiba.com.cn/db_games/activity/fishing/1539244791/
resource/assets/startScene/goldenbox.png'
},
//金宝箱
goldenbox
:
{
award
:
5
,
skin
:
'resource/assets/startScene/goldenbox.png'
},
//金宝箱
};
};
var
__bgUrl__
=
'
https://yun.duiba.com.cn/db_games/activity/fishing/1539244791/
resource/assets/startScene/bg.jpg'
;
var
__bgUrl__
=
'resource/assets/startScene/bg.jpg'
;
var
gameId
=
1
;
var
gameId
=
1
;
var
CFG
=
{
var
CFG
=
{
...
...
egret/libs/tl/MainBase.ts
View file @
17c44c38
...
@@ -19,7 +19,10 @@ export default class MainBase extends eui.UILayer {
...
@@ -19,7 +19,10 @@ export default class MainBase extends eui.UILayer {
if
(
RES
.
fileSystem
[
'getFileOld'
])
return
;
if
(
RES
.
fileSystem
[
'getFileOld'
])
return
;
RES
.
fileSystem
[
'getFileOld'
]
=
RES
.
fileSystem
.
getFile
;
RES
.
fileSystem
[
'getFileOld'
]
=
RES
.
fileSystem
.
getFile
;
window
[
'RES'
].
fileSystem
.
getFile
=
function
(
filename
:
string
)
{
window
[
'RES'
].
fileSystem
.
getFile
=
function
(
filename
:
string
)
{
console
.
log
(
"RES.fileSystem.getFile->"
,
filename
)
//生效情况
//RES.getResByUrl spritesheet类型
//不生效
//RES.getResAsync('net_png') spritesheet类型
if
(
filename
.
indexOf
(
'.json'
)
!=
-
1
)
{
if
(
filename
.
indexOf
(
'.json'
)
!=
-
1
)
{
var
arr
=
filename
.
split
(
'.json'
)[
0
].
split
(
'/'
);
var
arr
=
filename
.
split
(
'.json'
)[
0
].
split
(
'/'
);
var
filename1
=
arr
[
arr
.
length
-
1
]
+
'_png'
;
var
filename1
=
arr
[
arr
.
length
-
1
]
+
'_png'
;
...
@@ -28,10 +31,16 @@ export default class MainBase extends eui.UILayer {
...
@@ -28,10 +31,16 @@ export default class MainBase extends eui.UILayer {
RES
.
fileSystem
[
'fsData'
][
filename1
]
=
RES
.
fileSystem
[
'fsData'
][
filename1
]
=
{
name
:
filename1
,
type
:
'image'
,
url
:
filename2
,
root
:
''
,
extra
:
'1'
};
{
name
:
filename1
,
type
:
'image'
,
url
:
filename2
,
root
:
''
,
extra
:
'1'
};
}
}
var
result
=
RES
.
fileSystem
[
'getFileOld'
](
filename
);
var
result
=
RES
.
fileSystem
[
'getFileOld'
](
filename
);
if
(
result
&&
result
.
url
&&
check_webp_feature
())
{
if
(
result
&&
result
.
url
&&
check_webp_feature
())
{
//生效情况
//RES.getResByUrl jpg or png类型
//RES.getResAsync('monkey_png')
if
(
filename
.
indexOf
(
'png'
)
!=-
1
||
filename
.
indexOf
(
'jpg'
)
!=-
1
)
console
.
log
(
'已经处理:'
,
filename
)
result
=
JSON
.
parse
(
JSON
.
stringify
(
result
));
result
=
JSON
.
parse
(
JSON
.
stringify
(
result
));
result
.
url
=
result
.
url
.
replace
(
'.png'
,
'.png?x-oss-process=image/format,webp'
);
//
result.url = result.url.replace('.png', '.png?x-oss-process=image/format,webp');
result
.
url
=
result
.
url
.
replace
(
'.jpg'
,
'.jpg?x-oss-process=image/format,webp'
);
result
.
url
=
result
.
url
.
replace
(
'.jpg'
,
'.jpg?x-oss-process=image/format,webp'
);
}
}
return
result
;
return
result
;
...
...
egret/resource/assets/startScene/net.json
View file @
17c44c38
{
"file"
:
"net.png"
,
"frames"
:{
{
"file"
:
"net.png"
,
"frames"
:{
"01"
:{
"x"
:
1223
,
"y"
:
1
,
"w"
:
609
,
"h"
:
428
,
"offX"
:
69
,
"offY"
:
104
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"10"
:{
"x"
:
1222
,
"y"
:
0
,
"w"
:
609
,
"h"
:
428
,
"offX"
:
69
,
"offY"
:
104
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"02"
:{
"x"
:
613
,
"y"
:
431
,
"w"
:
610
,
"h"
:
414
,
"offX"
:
68
,
"offY"
:
81
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"09"
:{
"x"
:
611
,
"y"
:
0
,
"w"
:
609
,
"h"
:
428
,
"offX"
:
69
,
"offY"
:
104
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"03"
:{
"x"
:
1225
,
"y"
:
822
,
"w"
:
610
,
"h"
:
383
,
"offX"
:
68
,
"offY"
:
59
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"08"
:{
"x"
:
0
,
"y"
:
430
,
"w"
:
610
,
"h"
:
423
,
"offX"
:
68
,
"offY"
:
100
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"04"
:{
"x"
:
1
,
"y"
:
856
,
"w"
:
612
,
"h"
:
371
,
"offX"
:
65
,
"offY"
:
32
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"07"
:{
"x"
:
1224
,
"y"
:
430
,
"w"
:
610
,
"h"
:
389
,
"offX"
:
68
,
"offY"
:
84
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"05"
:{
"x"
:
1227
,
"y"
:
1207
,
"w"
:
610
,
"h"
:
371
,
"offX"
:
68
,
"offY"
:
19
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"06"
:{
"x"
:
614
,
"y"
:
1206
,
"w"
:
610
,
"h"
:
372
,
"offX"
:
68
,
"offY"
:
39
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"06"
:{
"x"
:
615
,
"y"
:
1207
,
"w"
:
610
,
"h"
:
372
,
"offX"
:
68
,
"offY"
:
39
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"05"
:{
"x"
:
1226
,
"y"
:
1206
,
"w"
:
610
,
"h"
:
371
,
"offX"
:
68
,
"offY"
:
19
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"07"
:{
"x"
:
1225
,
"y"
:
431
,
"w"
:
610
,
"h"
:
389
,
"offX"
:
68
,
"offY"
:
84
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"04"
:{
"x"
:
0
,
"y"
:
855
,
"w"
:
612
,
"h"
:
371
,
"offX"
:
65
,
"offY"
:
32
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"08"
:{
"x"
:
1
,
"y"
:
431
,
"w"
:
610
,
"h"
:
423
,
"offX"
:
68
,
"offY"
:
100
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"03"
:{
"x"
:
1224
,
"y"
:
821
,
"w"
:
610
,
"h"
:
383
,
"offX"
:
68
,
"offY"
:
59
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"09"
:{
"x"
:
612
,
"y"
:
1
,
"w"
:
609
,
"h"
:
428
,
"offX"
:
69
,
"offY"
:
104
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"02"
:{
"x"
:
612
,
"y"
:
430
,
"w"
:
610
,
"h"
:
414
,
"offX"
:
68
,
"offY"
:
81
,
"sourceW"
:
750
,
"sourceH"
:
558
},
"10"
:{
"x"
:
1
,
"y"
:
1
,
"w"
:
609
,
"h"
:
428
,
"offX"
:
69
,
"offY"
:
104
,
"sourceW"
:
750
,
"sourceH"
:
558
}}}
"01"
:{
"x"
:
0
,
"y"
:
0
,
"w"
:
609
,
"h"
:
428
,
"offX"
:
69
,
"offY"
:
104
,
"sourceW"
:
750
,
"sourceH"
:
558
}}}
\ No newline at end of file
\ No newline at end of file
egret/resource/assets/startScene/net.png
View replaced file @
6aa7b8e7
View file @
17c44c38
This diff is collapsed.
Click to expand it.
egret/resource/default.res.json
View file @
17c44c38
...
@@ -109,6 +109,11 @@
...
@@ -109,6 +109,11 @@
"type"
:
"sheet"
,
"type"
:
"sheet"
,
"name"
:
"net_json"
,
"name"
:
"net_json"
,
"subkeys"
:
"01,02,03,04,05,06,07,08,09,10"
"subkeys"
:
"01,02,03,04,05,06,07,08,09,10"
},
{
"url"
:
"assets/startScene/monkey.png"
,
"type"
:
"image"
,
"name"
:
"monkey_png"
}
}
]
]
}
}
\ No newline at end of file
egret/scripts/config.ts
View file @
17c44c38
...
@@ -34,7 +34,7 @@ const config: ResourceManagerConfig = {
...
@@ -34,7 +34,7 @@ const config: ResourceManagerConfig = {
return
{
return
{
outputDir
,
outputDir
,
commands
:
[
commands
:
[
new
ExmlPlugin
(
'commonjs'
),
// 非 EUI 项目关闭此设置
new
My
ExmlPlugin
(
'commonjs'
),
// 非 EUI 项目关闭此设置
new
TextureMergerPlugin
({
textureMergerRoot
:
[
'resource'
]
}),
new
TextureMergerPlugin
({
textureMergerRoot
:
[
'resource'
]
}),
new
ConvertResConfigFilePlugin
({
new
ConvertResConfigFilePlugin
({
resourceConfigFiles
:
[{
filename
:
"resource/default.res.json"
,
root
:
"resource/"
}],
resourceConfigFiles
:
[{
filename
:
"resource/default.res.json"
,
root
:
"resource/"
}],
...
...
egret/src/startScene/Monkey.ts
View file @
17c44c38
...
@@ -66,13 +66,11 @@ export default class Monkey extends egret.Sprite {
...
@@ -66,13 +66,11 @@ export default class Monkey extends egret.Sprite {
}
}
async
createBg
()
{
async
createBg
()
{
let
url
=
getResPath
()
+
`resource/assets/startScene/monkey.png`
;
return
new
Promise
(
async
(
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
const
picData
=
await
RES
.
getResAsync
(
'monkey_png'
);
RES
.
getResByUrl
(
url
,
(
picData
)
=>
{
const
pic
=
new
egret
.
Bitmap
(
picData
);
const
pic
=
new
egret
.
Bitmap
(
picData
);
this
.
addChild
(
pic
);
this
.
addChild
(
pic
);
resolve
(
pic
)
resolve
(
pic
)
},
this
,
RES
.
ResourceItem
.
TYPE_IMAGE
);
});
});
}
}
}
}
\ No newline at end of file
egret/src/startScene/Net.ts
View file @
17c44c38
import
SheetAnimation
from
"../components/SheetAnimation"
;
import
SheetAnimation
from
"../components/SheetAnimation"
;
import
{
getResPath
}
from
"../utils"
;
export
default
class
Net
extends
egret
.
Sprite
{
export
default
class
Net
extends
egret
.
Sprite
{
private
_pic
:
SheetAnimation
;
private
_pic
:
SheetAnimation
;
constructor
()
{
constructor
()
{
...
@@ -21,14 +22,16 @@ export default class Net extends egret.Sprite {
...
@@ -21,14 +22,16 @@ export default class Net extends egret.Sprite {
}
}
}
}
async
createBg
()
{
createBg
()
{
const
sheet
=
await
RES
.
getResAsync
(
'net_json'
)
as
egret
.
SpriteSheet
;
let
url
=
getResPath
()
+
`resource/assets/startScene/net.json`
;
RES
.
getResByUrl
(
url
,
(
sheet
:
egret
.
SpriteSheet
)
=>
{
this
.
_pic
.
sheet
=
sheet
;
this
.
_pic
.
sheet
=
sheet
;
this
.
_pic
.
fps
=
10
;
this
.
_pic
.
fps
=
10
;
this
.
alpha
=
0
;
this
.
alpha
=
0
;
egret
.
Tween
.
get
(
this
).
to
({
alpha
:
1
},
500
);
egret
.
Tween
.
get
(
this
).
to
({
alpha
:
1
},
500
);
setInterval
(()
=>
{
setInterval
(()
=>
{
this
.
doAction
()
this
.
doAction
()
},
5000
);
},
5000
);
},
this
,
RES
.
ResourceItem
.
TYPE_SHEET
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment