From 8bd790db67f3e2d7c50d4cca6fcbb7d88062e525 Mon Sep 17 00:00:00 2001 From: hyper Date: Sun, 12 Apr 2026 18:54:18 +0800 Subject: [PATCH] refactor: boop sizing --- packages/boop-game/src/scenes/PieceTypeSelector.ts | 10 +++++----- packages/boop-game/src/scenes/SupplyUI.ts | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/boop-game/src/scenes/PieceTypeSelector.ts b/packages/boop-game/src/scenes/PieceTypeSelector.ts index c8c3d0e..2c13822 100644 --- a/packages/boop-game/src/scenes/PieceTypeSelector.ts +++ b/packages/boop-game/src/scenes/PieceTypeSelector.ts @@ -11,18 +11,18 @@ export class PieceTypeSelector { constructor(private scene: Phaser.Scene) { const boardCenterX = BOARD_OFFSET.x + (BOARD_SIZE * CELL_SIZE) / 2; - const selectorY = BOARD_OFFSET.y + BOARD_SIZE * CELL_SIZE + 100; + const selectorY = BOARD_OFFSET.y + BOARD_SIZE * CELL_SIZE + 120; this.container = this.scene.add.container(boardCenterX, selectorY); const label = this.scene.add.text(-160, 0, '放置:', { - fontSize: '18px', + fontSize: '16px', fontFamily: 'Arial', color: '#4b5563', }).setOrigin(0.5, 0.5); - this.kittenButton = this.createPieceButton('kitten', '🐾 小猫', -50); - this.catButton = this.createPieceButton('cat', '🐱 大猫', 70); + this.kittenButton = this.createPieceButton('kitten', '🐾 小猫', -40); + this.catButton = this.createPieceButton('cat', '🐱 大猫', 80); this.container.add([label, this.kittenButton, this.catButton]); } @@ -30,7 +30,7 @@ export class PieceTypeSelector { private createPieceButton(type: PieceType, text: string, xOffset: number): Phaser.GameObjects.Container { const container = this.scene.add.container(xOffset, 0); - const bg = this.scene.add.rectangle(0, 0, 100, 40, 0xe5e7eb) + const bg = this.scene.add.rectangle(0, 0, 120, 40, 0xe5e7eb) .setStrokeStyle(2, 0x9ca3af); const textObj = this.scene.add.text(0, 0, text, { diff --git a/packages/boop-game/src/scenes/SupplyUI.ts b/packages/boop-game/src/scenes/SupplyUI.ts index e26c7b4..9660538 100644 --- a/packages/boop-game/src/scenes/SupplyUI.ts +++ b/packages/boop-game/src/scenes/SupplyUI.ts @@ -12,13 +12,13 @@ export class SupplyUI { constructor(private scene: Phaser.Scene) { const boardCenterX = BOARD_OFFSET.x + (BOARD_SIZE * CELL_SIZE) / 2; - const uiY = BOARD_OFFSET.y - 20; + const uiY = BOARD_OFFSET.y - 40; // 白色玩家容器 - this.whiteContainer = this.scene.add.container(boardCenterX - 150, uiY); - this.whiteBg = this.scene.add.rectangle(0, 0, 120, 50, 0x000000); + this.whiteContainer = this.scene.add.container(boardCenterX - 160, uiY); + this.whiteBg = this.scene.add.rectangle(0, 0, 120, 40, 0x000000); this.whiteText = this.scene.add.text(0, 0, '', { - fontSize: '16px', + fontSize: '12px', fontFamily: 'Arial', color: '#ffffff', align: 'center', @@ -27,10 +27,10 @@ export class SupplyUI { this.whiteContainer.setDepth(100); // 黑色玩家容器 - this.blackContainer = this.scene.add.container(boardCenterX + 150, uiY); - this.blackBg = this.scene.add.rectangle(0, 0, 120, 50, 0x333333); + this.blackContainer = this.scene.add.container(boardCenterX + 160, uiY); + this.blackBg = this.scene.add.rectangle(0, 0, 120, 40, 0x333333); this.blackText = this.scene.add.text(0, 0, '', { - fontSize: '16px', + fontSize: '12px', fontFamily: 'Arial', color: '#ffffff', align: 'center',