Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zjzy_client_game
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
王勇霞
zjzy_client_game
Commits
be550940
Commit
be550940
authored
Nov 24, 2022
by
王勇霞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除改成重绘
parent
aece1a34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
ResJson.ts
src/ResJson.ts
+1
-1
Game.ts
src/template/Game.ts
+20
-5
No files found.
src/ResJson.ts
View file @
be550940
...
...
@@ -892,5 +892,5 @@ export const ResJson = {
}
}
],
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/1669
191757
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/1669
275926
/resource/"
}
\ No newline at end of file
src/template/Game.ts
View file @
be550940
...
...
@@ -14,6 +14,7 @@ export class Game extends Scene {
needGuide
=
false
;
uiConfig
=
defaultUI
;
mainBg
;
backBtn
:
FYGE
.
Sprite
;
ruleBtn
:
FYGE
.
Sprite
;
startBtn
:
FYGE
.
Sprite
;
...
...
@@ -31,22 +32,25 @@ export class Game extends Scene {
guideCardList
=
[];
// 新手引导中的卡片列表
cardList
=
[];
// 游戏中的卡片列表
guideStep
=
1
;
// 引导步数
uiList
=
[];
// 用于重新绘制
initUi
()
{
this
.
needGuide
=
Tools
.
gameData
.
needGuide
;
// 模板中传过来的
this
.
uiConfig
=
Tools
.
gameData
.
uiConfig
;
// 模板中传过来的UI
UI
.
Sp
(
this
,
this
.
uiConfig
.
mainBg
,
0
,
0
);
this
.
mainBg
=
UI
.
Sp
(
this
,
this
.
uiConfig
.
mainBg
,
0
,
0
);
this
.
backBtn
=
UI
.
Sp
(
this
,
this
.
uiConfig
.
serviceBtn
,
0
,
274
);
this
.
ruleBtn
=
UI
.
Sp
(
this
,
this
.
uiConfig
.
ruleBtn
,
608
,
274
);
this
.
startBtn
=
UI
.
Sp
(
this
,
this
.
uiConfig
.
mainBtn
,
224
,
1231
);
// 遍历生成底图
this
.
uiList
=
[]
for
(
let
i
=
0
;
i
<
8
;
i
++
)
{
UI
.
Sp
(
let
cardUi
=
UI
.
Sp
(
this
,
this
.
uiConfig
[
"cardFontBg"
+
((
i
+
1
)
%
4
===
0
?
4
:
(
i
+
1
)
%
4
)],
Math
.
floor
(
i
%
4
)
*
168
+
50
,
Math
.
floor
(
i
/
4
)
*
360
-
15
+
538
);
this
.
uiList
.
push
(
cardUi
)
}
// 如果是新手引导阶段, 有手势引导
if
(
this
.
needGuide
)
{
...
...
@@ -199,9 +203,20 @@ export class Game extends Scene {
this
.
removeChild
(
this
.
gamelayer
);
}
editConfigImg
(
e
)
{
Tools
.
gameData
.
uiConfig
=
e
.
data
.
config
;
this
.
removeAllChildren
();
this
.
initUi
();
this
.
uiConfig
=
e
.
data
.
config
;
this
.
upDateUI
();
}
upDateUI
()
{
this
.
mainBg
.
texture
=
FYGE
.
Texture
.
fromUrl
(
this
.
uiConfig
.
mainBg
);
this
.
backBtn
.
texture
=
FYGE
.
Texture
.
fromUrl
(
this
.
uiConfig
.
serviceBtn
);
this
.
ruleBtn
.
texture
=
FYGE
.
Texture
.
fromUrl
(
this
.
uiConfig
.
ruleBtn
);
this
.
startBtn
.
texture
=
FYGE
.
Texture
.
fromUrl
(
this
.
uiConfig
.
mainBtn
);
this
.
uiList
.
map
((
item
,
i
)
=>
{
item
.
texture
=
FYGE
.
Texture
.
fromUrl
(
this
.
uiConfig
[
"cardFontBg"
+
((
i
+
1
)
%
4
===
0
?
4
:
(
i
+
1
)
%
4
)]
)
});
}
initEvents
()
{
super
.
initEvents
();
...
...
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