Commit ba561eae authored by Tt's avatar Tt

feat(play): 更新游戏页面资源并调整列表布局

parent 61b9b1a3
...@@ -355,7 +355,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -355,7 +355,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// // 创建list_item节点作为滑动列表容器 // // 创建list_item节点作为滑动列表容器
const listItem = this.g_cartoon.createCartoonElement('list_item', 'ShapeRectNew'); const listItem = this.g_cartoon.createCartoonElement('list_item', 'ShapeRectNew');
// 设置固定高度为800 // 设置固定高度为800
const listHeight = 800; const listHeight = 600;
// 每列最多2个子节点 // 每列最多2个子节点
const maxItemsPerColumn = 2; const maxItemsPerColumn = 2;
// 子节点数量 // 子节点数量
...@@ -363,8 +363,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -363,8 +363,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// 计算需要的列数 // 计算需要的列数
const columnsNeeded = Math.ceil(totalItems / maxItemsPerColumn); const columnsNeeded = Math.ceil(totalItems / maxItemsPerColumn);
// 每个子节点的宽度和高度 // 每个子节点的宽度和高度
const itemWidth = 300; const itemWidth = 280;
const itemHeight = 300; const itemHeight = 185;
// 子节点之间的间距 // 子节点之间的间距
const itemSpacing = 50; const itemSpacing = 50;
// 计算list_item的总宽度 // 计算list_item的总宽度
...@@ -373,7 +373,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -373,7 +373,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 初始化list_item - 将锚点设置为左侧 (0, 0.5) // 初始化list_item - 将锚点设置为左侧 (0, 0.5)
listItem.ref.init(null, 0, 0.5); listItem.ref.init(null, 0, 0.5);
listItem.ref.x = 0;//listWidth / 2; // 设置初始位置,使列表居中显示 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)'; listItem.ref.fillColor = 'rgba(231, 193, 193, 0.5)';
// 设置list_item的宽高 // 设置list_item的宽高
listItem.ref.setSize(listWidth, listHeight); listItem.ref.setSize(listWidth, listHeight);
...@@ -393,8 +393,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -393,8 +393,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// 创建子节点 // 创建子节点
const itemNode = this.g_cartoon.createCartoonElement(`list_item_${i}`, 'MySprite'); const itemNode = this.g_cartoon.createCartoonElement(`list_item_${i}`, 'MySprite');
// 使用pao_pao_da_png作为临时资源 // 使用bg_danci作为卡片背景资源
itemNode.ref.init(this.g_cartoon.images.get('pao_pao_da_png')); itemNode.ref.init(this.g_cartoon.images.get('bg_danci'));
// 计算子节点位置 - 基于左锚点的坐标计算 // 计算子节点位置 - 基于左锚点的坐标计算
// X坐标:从左到右排列,考虑间距,基于listItem的左边界 // X坐标:从左到右排列,考虑间距,基于listItem的左边界
......
...@@ -27,6 +27,12 @@ const localImages = { ...@@ -27,6 +27,12 @@ const localImages = {
'yu_gan': 'assets/game/yu_gan.png', 'yu_gan': 'assets/game/yu_gan.png',
'yu_xiang_zi': 'assets/game/yu_xiang_zi.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 // Game animations
'dao_ji_shi_1': 'assets/game/ani/VS_dong_hua_1/dao_ji_shi_1.png', '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', 'dao_ji_shi_2': 'assets/game/ani/VS_dong_hua_1/dao_ji_shi_2.png',
...@@ -140,6 +146,11 @@ const localAudios = { ...@@ -140,6 +146,11 @@ const localAudios = {
// 图片尺寸信息对象,存储每个图片的宽度和高度 // 图片尺寸信息对象,存储每个图片的宽度和高度
const localImagesSize = { 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': { width: 1280, height: 720 },
'bei_jing___jiao_shi': { width: 1280, height: 173 }, 'bei_jing___jiao_shi': { width: 1280, height: 173 },
...@@ -163,7 +174,7 @@ const localImagesSize = { ...@@ -163,7 +174,7 @@ const localImagesSize = {
'shan_guang': { width: 400, height: 388 }, 'shan_guang': { width: 400, height: 388 },
'yu_gan': { width: 25, height: 188 }, 'yu_gan': { width: 25, height: 188 },
'yu_xiang_zi': { width: 67, height: 53 }, 'yu_xiang_zi': { width: 67, height: 53 },
// VS动画 // VS动画
'dao_ji_shi_1': { width: 163, height: 242 }, 'dao_ji_shi_1': { width: 163, height: 242 },
'dao_ji_shi_2': { width: 163, height: 242 }, 'dao_ji_shi_2': { width: 163, height: 242 },
...@@ -174,7 +185,7 @@ const localImagesSize = { ...@@ -174,7 +185,7 @@ const localImagesSize = {
'lan_se_jian_bian': { width: 1400, height: 620 }, 'lan_se_jian_bian': { width: 1400, height: 620 },
's': { width: 221, height: 444 }, 's': { width: 221, height: 444 },
'v': { width: 210, height: 446 }, 'v': { width: 210, height: 446 },
// 灰猫招手动画 // 灰猫招手动画
'hui_mao_zhao_shou_1': { width: 109, height: 91 }, 'hui_mao_zhao_shou_1': { width: 109, height: 91 },
'hui_mao_zhao_shou_2': { width: 109, height: 91 }, 'hui_mao_zhao_shou_2': { width: 109, height: 91 },
...@@ -184,7 +195,7 @@ const localImagesSize = { ...@@ -184,7 +195,7 @@ const localImagesSize = {
'hui_mao_zhao_shou_6': { width: 109, height: 91 }, 'hui_mao_zhao_shou_6': { width: 109, height: 91 },
'hui_mao_zhao_shou_7': { width: 109, height: 91 }, 'hui_mao_zhao_shou_7': { width: 109, height: 91 },
'hui_mao_zhao_shou_8': { width: 109, height: 91 }, 'hui_mao_zhao_shou_8': { width: 109, height: 91 },
// 橘猫招手动画 // 橘猫招手动画
'ju_mao_zhao_shou_1': { width: 111, height: 91 }, 'ju_mao_zhao_shou_1': { width: 111, height: 91 },
'ju_mao_zhao_shou_2': { width: 111, height: 91 }, 'ju_mao_zhao_shou_2': { width: 111, height: 91 },
...@@ -192,7 +203,7 @@ const localImagesSize = { ...@@ -192,7 +203,7 @@ const localImagesSize = {
'ju_mao_zhao_shou_4': { width: 111, height: 91 }, 'ju_mao_zhao_shou_4': { width: 111, height: 91 },
'ju_mao_zhao_shou_5': { width: 111, height: 91 }, 'ju_mao_zhao_shou_5': { width: 111, height: 91 },
'ju_mao_zhao_shou_6': { width: 111, height: 91 }, 'ju_mao_zhao_shou_6': { width: 111, height: 91 },
// 泡泡爆破动画 // 泡泡爆破动画
'pao_pao_xu_lie_zhen_1': { width: 437, height: 346 }, 'pao_pao_xu_lie_zhen_1': { width: 437, height: 346 },
'pao_pao_xu_lie_zhen_2': { width: 437, height: 346 }, 'pao_pao_xu_lie_zhen_2': { width: 437, height: 346 },
...@@ -203,7 +214,7 @@ const localImagesSize = { ...@@ -203,7 +214,7 @@ const localImagesSize = {
'pao_pao_xu_lie_zhen_7': { width: 437, height: 346 }, 'pao_pao_xu_lie_zhen_7': { width: 437, height: 346 },
'pao_pao_xu_lie_zhen_8': { width: 437, height: 346 }, 'pao_pao_xu_lie_zhen_8': { width: 437, height: 346 },
'pao_pao_xu_lie_zhen_9': { width: 437, height: 346 }, 'pao_pao_xu_lie_zhen_9': { width: 437, height: 346 },
// 水底动画 // 水底动画
'shui_di_dong_hua_1': { width: 106, height: 102 }, 'shui_di_dong_hua_1': { width: 106, height: 102 },
'shui_di_dong_hua_2': { width: 106, height: 102 }, 'shui_di_dong_hua_2': { width: 106, height: 102 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment