refactor: boop sizing
This commit is contained in:
parent
93587541ce
commit
8bd790db67
|
|
@ -11,18 +11,18 @@ export class PieceTypeSelector {
|
||||||
|
|
||||||
constructor(private scene: Phaser.Scene) {
|
constructor(private scene: Phaser.Scene) {
|
||||||
const boardCenterX = BOARD_OFFSET.x + (BOARD_SIZE * CELL_SIZE) / 2;
|
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);
|
this.container = this.scene.add.container(boardCenterX, selectorY);
|
||||||
|
|
||||||
const label = this.scene.add.text(-160, 0, '放置:', {
|
const label = this.scene.add.text(-160, 0, '放置:', {
|
||||||
fontSize: '18px',
|
fontSize: '16px',
|
||||||
fontFamily: 'Arial',
|
fontFamily: 'Arial',
|
||||||
color: '#4b5563',
|
color: '#4b5563',
|
||||||
}).setOrigin(0.5, 0.5);
|
}).setOrigin(0.5, 0.5);
|
||||||
|
|
||||||
this.kittenButton = this.createPieceButton('kitten', '🐾 小猫', -50);
|
this.kittenButton = this.createPieceButton('kitten', '🐾 小猫', -40);
|
||||||
this.catButton = this.createPieceButton('cat', '🐱 大猫', 70);
|
this.catButton = this.createPieceButton('cat', '🐱 大猫', 80);
|
||||||
|
|
||||||
this.container.add([label, this.kittenButton, this.catButton]);
|
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 {
|
private createPieceButton(type: PieceType, text: string, xOffset: number): Phaser.GameObjects.Container {
|
||||||
const container = this.scene.add.container(xOffset, 0);
|
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);
|
.setStrokeStyle(2, 0x9ca3af);
|
||||||
|
|
||||||
const textObj = this.scene.add.text(0, 0, text, {
|
const textObj = this.scene.add.text(0, 0, text, {
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ export class SupplyUI {
|
||||||
|
|
||||||
constructor(private scene: Phaser.Scene) {
|
constructor(private scene: Phaser.Scene) {
|
||||||
const boardCenterX = BOARD_OFFSET.x + (BOARD_SIZE * CELL_SIZE) / 2;
|
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.whiteContainer = this.scene.add.container(boardCenterX - 160, uiY);
|
||||||
this.whiteBg = this.scene.add.rectangle(0, 0, 120, 50, 0x000000);
|
this.whiteBg = this.scene.add.rectangle(0, 0, 120, 40, 0x000000);
|
||||||
this.whiteText = this.scene.add.text(0, 0, '', {
|
this.whiteText = this.scene.add.text(0, 0, '', {
|
||||||
fontSize: '16px',
|
fontSize: '12px',
|
||||||
fontFamily: 'Arial',
|
fontFamily: 'Arial',
|
||||||
color: '#ffffff',
|
color: '#ffffff',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
@ -27,10 +27,10 @@ export class SupplyUI {
|
||||||
this.whiteContainer.setDepth(100);
|
this.whiteContainer.setDepth(100);
|
||||||
|
|
||||||
// 黑色玩家容器
|
// 黑色玩家容器
|
||||||
this.blackContainer = this.scene.add.container(boardCenterX + 150, uiY);
|
this.blackContainer = this.scene.add.container(boardCenterX + 160, uiY);
|
||||||
this.blackBg = this.scene.add.rectangle(0, 0, 120, 50, 0x333333);
|
this.blackBg = this.scene.add.rectangle(0, 0, 120, 40, 0x333333);
|
||||||
this.blackText = this.scene.add.text(0, 0, '', {
|
this.blackText = this.scene.add.text(0, 0, '', {
|
||||||
fontSize: '16px',
|
fontSize: '12px',
|
||||||
fontFamily: 'Arial',
|
fontFamily: 'Arial',
|
||||||
color: '#ffffff',
|
color: '#ffffff',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue