Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
JsxForFYGETemplate
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
spc
JsxForFYGETemplate
Commits
4980dee1
Commit
4980dee1
authored
Dec 05, 2022
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配淘宝环境处理
parent
09f8472b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
670 additions
and
21 deletions
+670
-21
mergeJs.js
scripts/mergeJs.js
+1
-0
ResJson.ts
src/ResJson.ts
+663
-16
GameScene.tsx
src/scenes/GameScene/GameScene.tsx
+4
-4
TbNet.ts
src/tools/TbNet.ts
+2
-1
No files found.
scripts/mergeJs.js
View file @
4980dee1
...
...
@@ -12,5 +12,6 @@ fs.writeFileSync(endPath + "output.js",
// 'import * as FYGE from "fyge";\n' +//以后改成这个
// 'import * as SvgaParser from "svga-parser";\n' +
'/* eslint-disable */
\
n'
+
'const FYGE = require("./fyge.min.js");
\
n'
+
fs
.
readFileSync
(
"./output.js"
));
console
.
log
(
"js生成"
)
src/ResJson.ts
View file @
4980dee1
...
...
@@ -2,63 +2,709 @@ export const ResJson = {
"groups"
:
[
{
"keys"
:
"box1.png,box2.png,box3.png,box4.png,box5.png,box6.png,box7.png,box8.png"
,
"name"
:
"Boxes"
"name"
:
"Boxes"
,
"atlas"
:
{
"box7.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
233
,
"h"
:
442
,
"ox"
:
26
,
"oy"
:
7
,
"sw"
:
283
,
"sh"
:
449
,
"ro"
:
false
},
"box8.png"
:
{
"x"
:
237
,
"y"
:
2
,
"w"
:
184
,
"h"
:
429
,
"ox"
:
50
,
"oy"
:
20
,
"sw"
:
283
,
"sh"
:
449
,
"ro"
:
false
},
"box3.png"
:
{
"x"
:
423
,
"y"
:
2
,
"w"
:
225
,
"h"
:
284
,
"ox"
:
29
,
"oy"
:
44
,
"sw"
:
283
,
"sh"
:
328
,
"ro"
:
false
},
"box2.png"
:
{
"x"
:
2
,
"y"
:
446
,
"w"
:
280
,
"h"
:
204
,
"ox"
:
0
,
"oy"
:
91
,
"sw"
:
283
,
"sh"
:
328
,
"ro"
:
false
},
"box4.png"
:
{
"x"
:
284
,
"y"
:
433
,
"w"
:
184
,
"h"
:
276
,
"ox"
:
50
,
"oy"
:
52
,
"sw"
:
283
,
"sh"
:
328
,
"ro"
:
true
},
"box6.png"
:
{
"x"
:
650
,
"y"
:
2
,
"w"
:
255
,
"h"
:
221
,
"ox"
:
14
,
"oy"
:
95
,
"sw"
:
283
,
"sh"
:
328
,
"ro"
:
true
},
"box1.png"
:
{
"x"
:
650
,
"y"
:
259
,
"w"
:
228
,
"h"
:
214
,
"ox"
:
28
,
"oy"
:
92
,
"sw"
:
283
,
"sh"
:
328
,
"ro"
:
true
},
"box5.png"
:
{
"x"
:
423
,
"y"
:
288
,
"w"
:
224
,
"h"
:
142
,
"ox"
:
30
,
"oy"
:
151
,
"sw"
:
283
,
"sh"
:
328
,
"ro"
:
false
}
}
},
{
"keys"
:
"DFM1.png,DFMB.png"
,
"name"
:
"DrawFailModal"
"name"
:
"DrawFailModal"
,
"atlas"
:
{
"DFMB.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
541
,
"h"
:
467
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
541
,
"sh"
:
467
,
"ro"
:
false
},
"DFM1.png"
:
{
"x"
:
2
,
"y"
:
471
,
"w"
:
369
,
"h"
:
97
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
369
,
"sh"
:
97
,
"ro"
:
false
}
}
},
{
"keys"
:
"DSM1.png,DSMB.png"
,
"name"
:
"DrawSucModal"
"name"
:
"DrawSucModal"
,
"atlas"
:
{
"DSMB.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
576
,
"h"
:
747
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
576
,
"sh"
:
747
,
"ro"
:
false
},
"DSM1.png"
:
{
"x"
:
580
,
"y"
:
2
,
"w"
:
369
,
"h"
:
97
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
369
,
"sh"
:
97
,
"ro"
:
true
}
}
},
{
"keys"
:
"FGM1.png,FGMB.png"
,
"name"
:
"FinalGiftModal"
"name"
:
"FinalGiftModal"
,
"atlas"
:
{
"FGMB.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
503
,
"h"
:
571
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
503
,
"sh"
:
571
,
"ro"
:
false
},
"FGM1.png"
:
{
"x"
:
507
,
"y"
:
2
,
"w"
:
369
,
"h"
:
97
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
369
,
"sh"
:
97
,
"ro"
:
true
}
}
},
{
"keys"
:
"2b727ace1b5c959dbc6274cacb5b4e5f.png,3ed4431aad269ef7059929043bd45597.png,60377934f7cf618b52457273db65aace.png,9074d1305c0e7feb16037261986c7f4b.png,f3bde4659477f82338fcb2b134272321.png"
,
"name"
:
"GameAtom"
"name"
:
"GameAtom"
,
"atlas"
:
{
"f3bde4659477f82338fcb2b134272321.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
26
,
"h"
:
26
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
26
,
"sh"
:
26
,
"ro"
:
false
},
"3ed4431aad269ef7059929043bd45597.png"
:
{
"x"
:
30
,
"y"
:
2
,
"w"
:
19
,
"h"
:
19
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
19
,
"sh"
:
19
,
"ro"
:
false
},
"60377934f7cf618b52457273db65aace.png"
:
{
"x"
:
30
,
"y"
:
23
,
"w"
:
19
,
"h"
:
18
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
19
,
"sh"
:
18
,
"ro"
:
false
},
"2b727ace1b5c959dbc6274cacb5b4e5f.png"
:
{
"x"
:
2
,
"y"
:
30
,
"w"
:
12
,
"h"
:
11
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
12
,
"sh"
:
11
,
"ro"
:
true
},
"9074d1305c0e7feb16037261986c7f4b.png"
:
{
"x"
:
15
,
"y"
:
30
,
"w"
:
7
,
"h"
:
7
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
7
,
"sh"
:
7
,
"ro"
:
false
}
}
},
{
"keys"
:
"GOM0.png,GOM1.png,GameOverModalBack.png"
,
"name"
:
"GameOverModal"
"name"
:
"GameOverModal"
,
"atlas"
:
{
"GameOverModalBack.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
576
,
"h"
:
739
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
576
,
"sh"
:
739
,
"ro"
:
false
},
"GOM1.png"
:
{
"x"
:
580
,
"y"
:
2
,
"w"
:
369
,
"h"
:
97
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
369
,
"sh"
:
97
,
"ro"
:
true
},
"GOM0.png"
:
{
"x"
:
580
,
"y"
:
373
,
"w"
:
163
,
"h"
:
50
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
163
,
"sh"
:
50
,
"ro"
:
true
}
}
},
{
"keys"
:
"GQM0.png,GQM1.png,GQMB.png"
,
"name"
:
"GameQuitModal"
"name"
:
"GameQuitModal"
,
"atlas"
:
{
"GQMB.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
601
,
"h"
:
467
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
601
,
"sh"
:
467
,
"ro"
:
false
},
"GQM1.png"
:
{
"x"
:
2
,
"y"
:
471
,
"w"
:
249
,
"h"
:
97
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
249
,
"sh"
:
97
,
"ro"
:
false
},
"GQM0.png"
:
{
"x"
:
253
,
"y"
:
471
,
"w"
:
231
,
"h"
:
91
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
231
,
"sh"
:
91
,
"ro"
:
false
}
}
},
{
"keys"
:
"GameResumeModalBack.png,cancelBtn.png,useRightNowBtn.png"
,
"name"
:
"GameResumeModal"
"name"
:
"GameResumeModal"
,
"atlas"
:
{
"GameResumeModalBack.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
601
,
"h"
:
547
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
601
,
"sh"
:
547
,
"ro"
:
false
},
"useRightNowBtn.png"
:
{
"x"
:
2
,
"y"
:
551
,
"w"
:
369
,
"h"
:
97
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
369
,
"sh"
:
97
,
"ro"
:
false
},
"cancelBtn.png"
:
{
"x"
:
373
,
"y"
:
551
,
"w"
:
230
,
"h"
:
66
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
230
,
"sh"
:
66
,
"ro"
:
false
}
}
},
{
"keys"
:
"back.png,bottomAtom.png,gele1.png,goBackBtn.png,player.png,scoreboard-t.png"
,
"name"
:
"GameScene"
"name"
:
"GameScene"
,
"atlas"
:
{
"back.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
750
,
"h"
:
1624
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
750
,
"sh"
:
1624
,
"ro"
:
false
},
"bottomAtom.png"
:
{
"x"
:
754
,
"y"
:
2
,
"w"
:
750
,
"h"
:
340
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
750
,
"sh"
:
340
,
"ro"
:
true
},
"gele1.png"
:
{
"x"
:
754
,
"y"
:
754
,
"w"
:
279
,
"h"
:
204
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
279
,
"sh"
:
204
,
"ro"
:
false
},
"player.png"
:
{
"x"
:
754
,
"y"
:
960
,
"w"
:
132
,
"h"
:
201
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
132
,
"sh"
:
201
,
"ro"
:
true
},
"goBackBtn.png"
:
{
"x"
:
957
,
"y"
:
960
,
"w"
:
138
,
"h"
:
68
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
138
,
"sh"
:
68
,
"ro"
:
true
},
"scoreboard-t.png"
:
{
"x"
:
1035
,
"y"
:
754
,
"w"
:
86
,
"h"
:
38
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
86
,
"sh"
:
38
,
"ro"
:
true
}
}
},
{
"keys"
:
"2120075482341d7d94d8164b1a0f6d43.png,3ed4431aad269ef7059929043bd45597.png,4f4612689c9fde32a8c28c129e9f6e7d.png,60377934f7cf618b52457273db65aace.png,63b0a84f0f9b10842b5f83fa5e923534.png,f3bde4659477f82338fcb2b134272321.png"
,
"name"
:
"JumpEnd"
"name"
:
"JumpEnd"
,
"atlas"
:
{
"2120075482341d7d94d8164b1a0f6d43.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
274
,
"h"
:
294
,
"ox"
:
25
,
"oy"
:
21
,
"sw"
:
323
,
"sh"
:
323
,
"ro"
:
false
},
"f3bde4659477f82338fcb2b134272321.png"
:
{
"x"
:
278
,
"y"
:
2
,
"w"
:
26
,
"h"
:
26
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
26
,
"sh"
:
26
,
"ro"
:
false
},
"4f4612689c9fde32a8c28c129e9f6e7d.png"
:
{
"x"
:
278
,
"y"
:
30
,
"w"
:
25
,
"h"
:
25
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
25
,
"sh"
:
25
,
"ro"
:
false
},
"63b0a84f0f9b10842b5f83fa5e923534.png"
:
{
"x"
:
278
,
"y"
:
57
,
"w"
:
25
,
"h"
:
25
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
25
,
"sh"
:
25
,
"ro"
:
false
},
"3ed4431aad269ef7059929043bd45597.png"
:
{
"x"
:
278
,
"y"
:
84
,
"w"
:
19
,
"h"
:
19
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
19
,
"sh"
:
19
,
"ro"
:
false
},
"60377934f7cf618b52457273db65aace.png"
:
{
"x"
:
278
,
"y"
:
105
,
"w"
:
19
,
"h"
:
18
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
19
,
"sh"
:
18
,
"ro"
:
false
}
}
},
{
"keys"
:
"Guide1.png,NGSB.jpg,nextStep.png,startGameBtn.png"
,
"name"
:
"NewGuyScene"
"name"
:
"NewGuyScene"
,
"atlas"
:
{
"Guide1.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
750
,
"h"
:
1624
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
750
,
"sh"
:
1624
,
"ro"
:
false
},
"nextStep.png"
:
{
"x"
:
754
,
"y"
:
2
,
"w"
:
203
,
"h"
:
60
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
203
,
"sh"
:
60
,
"ro"
:
true
},
"startGameBtn.png"
:
{
"x"
:
754
,
"y"
:
207
,
"w"
:
203
,
"h"
:
60
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
203
,
"sh"
:
60
,
"ro"
:
true
}
}
},
{
"keys"
:
"2120075482341d7d94d8164b1a0f6d43.png"
,
"name"
:
"PerfectJumpEnd"
"name"
:
"PerfectJumpEnd"
,
"atlas"
:
{
"2120075482341d7d94d8164b1a0f6d43.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
274
,
"h"
:
294
,
"ox"
:
25
,
"oy"
:
21
,
"sw"
:
323
,
"sh"
:
323
,
"ro"
:
false
}
}
},
{
"keys"
:
"closebtn.png,giftBoxIcon.png,waitingBg.png,waitingRot.png"
,
"name"
:
"common"
"name"
:
"common"
,
"atlas"
:
{
"waitingBg.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
160
,
"h"
:
180
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
160
,
"sh"
:
180
,
"ro"
:
false
},
"giftBoxIcon.png"
:
{
"x"
:
164
,
"y"
:
2
,
"w"
:
127
,
"h"
:
125
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
127
,
"sh"
:
125
,
"ro"
:
true
},
"waitingRot.png"
:
{
"x"
:
2
,
"y"
:
184
,
"w"
:
56
,
"h"
:
56
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
56
,
"sh"
:
56
,
"ro"
:
false
},
"closebtn.png"
:
{
"x"
:
60
,
"y"
:
184
,
"w"
:
52
,
"h"
:
52
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
52
,
"sh"
:
52
,
"ro"
:
false
}
}
},
{
"keys"
:
"786bf3500cf0986c9678f6b8a8cf24f6.png,b5d5c1070b13deb0230b0efe5c58ee9d.png,ca7b2a497afc6147cc076d55600154bd.png,d64a974a921d32ed81463c918bae137e.png,f49a78c8287be1a92ee75ce3a2b7a512.png"
,
"name"
:
"countDown"
"name"
:
"countDown"
,
"atlas"
:
{
"ca7b2a497afc6147cc076d55600154bd.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
109
,
"h"
:
175
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
109
,
"sh"
:
175
,
"ro"
:
false
},
"786bf3500cf0986c9678f6b8a8cf24f6.png"
:
{
"x"
:
113
,
"y"
:
2
,
"w"
:
98
,
"h"
:
172
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
98
,
"sh"
:
172
,
"ro"
:
false
},
"d64a974a921d32ed81463c918bae137e.png"
:
{
"x"
:
2
,
"y"
:
179
,
"w"
:
110
,
"h"
:
172
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
110
,
"sh"
:
172
,
"ro"
:
true
},
"f49a78c8287be1a92ee75ce3a2b7a512.png"
:
{
"x"
:
213
,
"y"
:
2
,
"w"
:
104
,
"h"
:
105
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
104
,
"sh"
:
105
,
"ro"
:
false
},
"b5d5c1070b13deb0230b0efe5c58ee9d.png"
:
{
"x"
:
213
,
"y"
:
109
,
"w"
:
53
,
"h"
:
53
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
53
,
"sh"
:
53
,
"ro"
:
false
}
}
},
{
"keys"
:
"548342251013e2f832a40380d1855bf5.png,af75d547153d9118b05d4dd8fbcfe022.png,fd0f936244fb973bddf520819997f5ba.png"
,
"name"
:
"handLottie"
"name"
:
"handLottie"
,
"atlas"
:
{
"fd0f936244fb973bddf520819997f5ba.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
120
,
"h"
:
87
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
120
,
"sh"
:
87
,
"ro"
:
false
},
"af75d547153d9118b05d4dd8fbcfe022.png"
:
{
"x"
:
2
,
"y"
:
91
,
"w"
:
92
,
"h"
:
92
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
92
,
"sh"
:
92
,
"ro"
:
false
},
"548342251013e2f832a40380d1855bf5.png"
:
{
"x"
:
124
,
"y"
:
2
,
"w"
:
46
,
"h"
:
46
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
46
,
"sh"
:
46
,
"ro"
:
false
}
}
},
{
"keys"
:
"nx1.jpg,ny1.jpg,nz1.jpg,px1.jpg,py1.jpg,pz1.jpg"
,
...
...
@@ -69,5 +715,6 @@ export const ResJson = {
"name"
:
"spine"
}
],
"path"
:
"./resource/"
// eslint-disable-next-line
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/1670224643/resource/"
}
\ No newline at end of file
src/scenes/GameScene/GameScene.tsx
View file @
4980dee1
...
...
@@ -169,18 +169,18 @@ export class GameScene extends Dream.RenderContainer {
* 绑定事件
*/
initEvents
()
{
if
(
GameConfig
.
debugger
)
{
if
(
GameConfig
.
debugger
&&
document
)
{
document
.
body
.
addEventListener
(
'keydown'
,
(
e
)
=>
{
if
(
e
.
code
!=
"Space"
)
return
;
this
.
onActionDown
();
})
}
this
.
sceneCont
.
addEventListener
(
FYGE
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onActionDown
,
this
)
this
.
sceneCont
?
.
addEventListener
(
FYGE
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onActionDown
,
this
)
}
removeEvents
()
{
this
.
sceneCont
.
removeAllEventListener
()
this
.
sceneCont
?
.
removeAllEventListener
()
}
/**
...
...
@@ -201,7 +201,7 @@ export class GameScene extends Dream.RenderContainer {
console
.
log
(
'最远距离了'
)
})
if
(
GameConfig
.
debugger
)
{
if
(
GameConfig
.
debugger
&&
document
)
{
document
.
body
.
addEventListener
(
'keyup'
,
async
()
=>
{
this
.
onActionUp
()
},
{
once
:
true
})
...
...
src/tools/TbNet.ts
View file @
4980dee1
...
...
@@ -63,7 +63,8 @@ export function sendTbNet(
//网络超时
// let waitObj;
//@ts-ignore 本地开发,直接取数据
if
(
location
.
port
==
'8081'
)
{
console
.
log
(
'send tbNet ==========='
)
if
(
location
&&
location
.
port
==
'8081'
)
{
const
netInfo
=
netName
.
split
(
"."
);
const
url
=
`../../mock/miniTb/
${
netInfo
[
0
]}
/
${
netInfo
[
1
]}
.json`
;
fetchAsync
(
url
)
...
...
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