refactor: fix onitama sizing

This commit is contained in:
hyper
2026-04-12 19:24:47 +08:00
parent e5b53c6332
commit 02d2f45da2
5 changed files with 36 additions and 27 deletions
@@ -17,12 +17,12 @@ const MENU_CONFIG = {
},
button: {
width: 200,
height: 60,
height: 80,
},
positions: {
titleY: -100,
titleY: -120,
buttonY: 40,
subtitleY: 140,
subtitleY: 160,
},
} as const;
@@ -60,11 +60,11 @@ export class OnitamaScene extends GameHostScene<OnitamaState> {
// Info text
this.infoText = this.add.text(
20,
40,
BOARD_OFFSET.y,
'',
{
fontSize: '15px',
fontSize: '16px',
fontFamily: 'Arial',
color: '#4b5563',
}
@@ -94,7 +94,7 @@ export class OnitamaScene extends GameHostScene<OnitamaState> {
// Red cards label - 棋盘下方
const redLabel = this.add.text(
boardLeft + (BOARD_SIZE * CELL_SIZE) / 2,
boardBottom + 10,
boardBottom + 40,
"RED",
{
fontSize: '16px',
@@ -107,7 +107,7 @@ export class OnitamaScene extends GameHostScene<OnitamaState> {
// Black cards label - 棋盘上方
const blackLabel = this.add.text(
boardLeft + (BOARD_SIZE * CELL_SIZE) / 2,
boardTop - 10,
boardTop - 40,
"BLACK",
{
fontSize: '16px',
@@ -150,8 +150,8 @@ export class OnitamaScene extends GameHostScene<OnitamaState> {
g.strokePath();
this.add.text(
20,
20,
40,
40,
'Onitama',
{
fontSize: '28px',
@@ -231,8 +231,8 @@ export class OnitamaScene extends GameHostScene<OnitamaState> {
/** 创建菜单按钮 */
private createMenuButton(): void {
const buttonX = this.game.scale.width - 80;
const buttonY = 30;
const buttonX = 680;
const buttonY = 40;
this.menuButtonBg = this.add.rectangle(buttonX, buttonY, 120, 40, 0x6b7280)
.setInteractive({ useHandCursor: true });