Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSIWB2504
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
SSIWB2504
Commits
ba561eae
Commit
ba561eae
authored
Aug 04, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(play): 更新游戏页面资源并调整列表布局
parent
61b9b1a3
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
11 deletions
+22
-11
play.component.ts
src/app/play/play.component.ts
+6
-6
resources.js
src/app/play/resources.js
+16
-5
bg_danci.png
src/assets/game/page/bg_danci.png
+0
-0
bg_title.png
src/assets/game/page/bg_title.png
+0
-0
dui_hao.png
src/assets/game/page/dui_hao.png
+0
-0
kai_shi.png
src/assets/game/page/kai_shi.png
+0
-0
xuan_ze.png
src/assets/game/page/xuan_ze.png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
ba561eae
...
...
@@ -355,7 +355,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// // 创建list_item节点作为滑动列表容器
const
listItem
=
this
.
g_cartoon
.
createCartoonElement
(
'
list_item
'
,
'
ShapeRectNew
'
);
// 设置固定高度为800
const
listHeight
=
8
00
;
const
listHeight
=
6
00
;
// 每列最多2个子节点
const
maxItemsPerColumn
=
2
;
// 子节点数量
...
...
@@ -363,8 +363,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// 计算需要的列数
const
columnsNeeded
=
Math
.
ceil
(
totalItems
/
maxItemsPerColumn
);
// 每个子节点的宽度和高度
const
itemWidth
=
30
0
;
const
itemHeight
=
300
;
const
itemWidth
=
28
0
;
const
itemHeight
=
185
;
// 子节点之间的间距
const
itemSpacing
=
50
;
// 计算list_item的总宽度
...
...
@@ -373,7 +373,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 初始化list_item - 将锚点设置为左侧 (0, 0.5)
listItem
.
ref
.
init
(
null
,
0
,
0.5
);
listItem
.
ref
.
x
=
0
;
//listWidth / 2; // 设置初始位置,使列表居中显示
listItem
.
ref
.
y
=
this
.
g_canvasHeight
/
2
;
listItem
.
ref
.
y
=
this
.
g_canvasHeight
/
2
+
100
;
listItem
.
ref
.
fillColor
=
'
rgba(231, 193, 193, 0.5)
'
;
// 设置list_item的宽高
listItem
.
ref
.
setSize
(
listWidth
,
listHeight
);
...
...
@@ -393,8 +393,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// 创建子节点
const
itemNode
=
this
.
g_cartoon
.
createCartoonElement
(
`list_item_
${
i
}
`
,
'
MySprite
'
);
// 使用
pao_pao_da_png作为临时
资源
itemNode
.
ref
.
init
(
this
.
g_cartoon
.
images
.
get
(
'
pao_pao_da_png
'
));
// 使用
bg_danci作为卡片背景
资源
itemNode
.
ref
.
init
(
this
.
g_cartoon
.
images
.
get
(
'
bg_danci
'
));
// 计算子节点位置 - 基于左锚点的坐标计算
// X坐标:从左到右排列,考虑间距,基于listItem的左边界
...
...
src/app/play/resources.js
View file @
ba561eae
...
...
@@ -27,6 +27,12 @@ const localImages = {
'
yu_gan
'
:
'
assets/game/yu_gan.png
'
,
'
yu_xiang_zi
'
:
'
assets/game/yu_xiang_zi.png
'
,
'
bg_danci
'
:
'
assets/game/page/bg_danci.png
'
,
'
bg_title
'
:
'
assets/game/page/bg_title.png
'
,
'
dui_hao
'
:
'
assets/game/page/dui_hao.png
'
,
'
kai_shi
'
:
'
assets/game/page/kai_shi.png
'
,
'
xuan_ze
'
:
'
assets/game/page/xuan_ze.png
'
,
// Game animations
'
dao_ji_shi_1
'
:
'
assets/game/ani/VS_dong_hua_1/dao_ji_shi_1.png
'
,
'
dao_ji_shi_2
'
:
'
assets/game/ani/VS_dong_hua_1/dao_ji_shi_2.png
'
,
...
...
@@ -140,6 +146,11 @@ const localAudios = {
// 图片尺寸信息对象,存储每个图片的宽度和高度
const
localImagesSize
=
{
'
bg_danci
'
:
{
width
:
280
,
height
:
185
},
'
bg_title
'
:
{
width
:
416
,
height
:
95
},
'
dui_hao
'
:
{
width
:
89
,
height
:
64
},
'
kai_shi
'
:
{
width
:
209
,
height
:
65
},
'
xuan_ze
'
:
{
width
:
209
,
height
:
65
},
// 主目录图片
'
bei_jing
'
:
{
width
:
1280
,
height
:
720
},
'
bei_jing___jiao_shi
'
:
{
width
:
1280
,
height
:
173
},
...
...
src/assets/game/page/bg_danci.png
0 → 100644
View file @
ba561eae
7.84 KB
src/assets/game/page/bg_title.png
0 → 100644
View file @
ba561eae
11.5 KB
src/assets/game/page/dui_hao.png
0 → 100644
View file @
ba561eae
4.74 KB
src/assets/game/page/kai_shi.png
0 → 100644
View file @
ba561eae
7.22 KB
src/assets/game/page/xuan_ze.png
0 → 100644
View file @
ba561eae
6.61 KB
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