Commit 1caef1db authored by 李维's avatar 李维

fix: 调整布局

parent ab07cf77
...@@ -6,6 +6,7 @@ interface GameCardData { ...@@ -6,6 +6,7 @@ interface GameCardData {
template_name: string; template_name: string;
template_description: string; template_description: string;
cover: string; cover: string;
cw_cover: string;
data: string; data: string;
seq: number; seq: number;
} }
...@@ -42,8 +43,9 @@ export default class GameCard extends cc.Component { ...@@ -42,8 +43,9 @@ export default class GameCard extends cc.Component {
} }
// 加载并设置缩略图 // 加载并设置缩略图
if (this.thumbnailSprite && this.gameData.cover) { if (this.thumbnailSprite && (this.gameData.cover || this.gameData.cw_cover)) {
cc.loader.load(this.gameData.cover, (err, texture) => { const cv = this.gameData.cw_cover ? this.gameData.cw_cover : this.gameData.cover;
cc.loader.load(cv, (err, texture) => {
if (!err && texture) { if (!err && texture) {
const spriteFrame = new cc.SpriteFrame(texture); const spriteFrame = new cc.SpriteFrame(texture);
this.thumbnailSprite.spriteFrame = spriteFrame; this.thumbnailSprite.spriteFrame = spriteFrame;
......
...@@ -872,7 +872,7 @@ ...@@ -872,7 +872,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 3000, "width": 3700,
"height": 600 "height": 600
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -1107,7 +1107,7 @@ ...@@ -1107,7 +1107,7 @@
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 3000, "width": 3700,
"height": 600 "height": 600
}, },
"_resize": 1, "_resize": 1,
......
...@@ -346,19 +346,19 @@ export default class GameCenter extends cc.Component { ...@@ -346,19 +346,19 @@ export default class GameCenter extends cc.Component {
}); });
// 设置内容节点大小 - 以(0,0)为中心 // 设置内容节点大小 - 以(0,0)为中心
const cardWidth = 400; // 卡片宽度 const cardWidth = 500; // 卡片宽度
const cardHeight = 300; // 卡片高度 const cardHeight = 259; // 卡片高度
const spacing = 30; // 卡片间距 const spacing = 30; // 卡片间距
const totalCards = Math.ceil(this.gameDataList.length/2); const totalCards = Math.ceil(this.gameDataList.length/2);
console.log('卡片尺寸信息:', { cardWidth, cardHeight, spacing, totalCards }); console.log('卡片尺寸信息:', { cardWidth, cardHeight, spacing, totalCards });
if (totalCards > 0) { if (totalCards > 0) {
const totalWidth = totalCards * cardWidth + (totalCards - 1) * spacing; // const totalWidth = totalCards * cardWidth + totalCards * spacing;
content.width = totalWidth; // content.width = totalWidth;
content.height = cardHeight; // content.height = cardHeight;
console.log('设置content节点大小:', { width: content.width, height: content.height }); console.log('设置content节点大小:', { width: content.width, heigsht: content.height });
console.log('设置content节点锚点:', { anchorX: content.anchorX, anchorY: content.anchorY }); console.log('设置content节点锚点:', { anchorX: content.anchorX, anchorY: content.anchorY });
} else { } else {
console.warn('没有游戏数据,无法设置内容节点大小'); console.warn('没有游戏数据,无法设置内容节点大小');
......
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-1.089, -1.089,
-106.039, -101.039,
0, 0,
0, 0,
0, 0,
...@@ -379,8 +379,8 @@ ...@@ -379,8 +379,8 @@
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "", "_string": "",
"_N$string": "", "_N$string": "",
"_fontSize": 26, "_fontSize": 22,
"_lineHeight": 32, "_lineHeight": 22,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": null, "_N$file": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
......
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