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

fix: 调整布局

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