refactor: reposition player UI elements and add chip rotation for Phase 10
- Update portrait and nameLabel coordinates for top, bottom, left, and right slots to improve layout alignment - Adjust chip positions for left and right slots to better fit the new UI design - Add chipRotation property to left and right slot layouts to rotate phase chips appropriately - Apply chip rotation in makeSeatChip when layout.chipRotation is defined
This commit is contained in:
parent
a4c8f659ee
commit
7b817ea3a4
|
|
@ -68,8 +68,8 @@ function slotLayout(slot) {
|
||||||
handFaceUp: true,
|
handFaceUp: true,
|
||||||
laidStart: { x: 200, y: 820 },
|
laidStart: { x: 200, y: 820 },
|
||||||
laidAxis: 'x',
|
laidAxis: 'x',
|
||||||
portrait: { x: 350, y: 990, r: 56 },
|
portrait: { x: 684, y: 846, r: 56 },
|
||||||
nameLabel: { x: 350, y: 1056 },
|
nameLabel: { x: 684, y: 916 },
|
||||||
chip: { x: 752, y: 870 },
|
chip: { x: 752, y: 870 },
|
||||||
rotateCards: 0,
|
rotateCards: 0,
|
||||||
};
|
};
|
||||||
|
|
@ -81,8 +81,8 @@ function slotLayout(slot) {
|
||||||
handFaceUp: false,
|
handFaceUp: false,
|
||||||
laidStart: { x: 200, y: 200 },
|
laidStart: { x: 200, y: 200 },
|
||||||
laidAxis: 'x',
|
laidAxis: 'x',
|
||||||
portrait: { x: 350, y: 70, r: 50 },
|
portrait: { x: 1094, y: 198, r: 50 },
|
||||||
nameLabel: { x: 350, y: 134 },
|
nameLabel: { x: 1094, y: 262 },
|
||||||
chip: { x: 752, y: 180 },
|
chip: { x: 752, y: 180 },
|
||||||
rotateCards: 180,
|
rotateCards: 180,
|
||||||
};
|
};
|
||||||
|
|
@ -94,9 +94,10 @@ function slotLayout(slot) {
|
||||||
handFaceUp: false,
|
handFaceUp: false,
|
||||||
laidStart: { x: 200, y: 480 },
|
laidStart: { x: 200, y: 480 },
|
||||||
laidAxis: 'y',
|
laidAxis: 'y',
|
||||||
portrait: { x: 100, y: 130, r: 50 },
|
portrait: { x: 180, y: 266, r: 50 },
|
||||||
nameLabel: { x: 100, y: 196 },
|
nameLabel: { x: 180, y: 202 },
|
||||||
chip: { x: 148, y: 468 },
|
chip: { x: 180, y: 328 },
|
||||||
|
chipRotation: Math.PI / 2,
|
||||||
rotateCards: 90,
|
rotateCards: 90,
|
||||||
};
|
};
|
||||||
case 'right':
|
case 'right':
|
||||||
|
|
@ -107,9 +108,10 @@ function slotLayout(slot) {
|
||||||
handFaceUp: false,
|
handFaceUp: false,
|
||||||
laidStart: { x: 1720, y: 480 },
|
laidStart: { x: 1720, y: 480 },
|
||||||
laidAxis: 'y',
|
laidAxis: 'y',
|
||||||
portrait: { x: 1820, y: 130, r: 50 },
|
portrait: { x: 1740, y: 670, r: 50 },
|
||||||
nameLabel: { x: 1820, y: 196 },
|
nameLabel: { x: 1740, y: 734 },
|
||||||
chip: { x: 1492, y: 468 },
|
chip: { x: 1740, y: 608 },
|
||||||
|
chipRotation: -Math.PI / 2,
|
||||||
rotateCards: 270,
|
rotateCards: 270,
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
|
|
@ -207,6 +209,7 @@ export default class Phase10Game extends Phaser.Scene {
|
||||||
|
|
||||||
// Phase chip + score badge anchored next to portrait.
|
// Phase chip + score badge anchored next to portrait.
|
||||||
this.seatChips[seat] = this.makeSeatChip(seat, layout.chip.x, layout.chip.y);
|
this.seatChips[seat] = this.makeSeatChip(seat, layout.chip.x, layout.chip.y);
|
||||||
|
if (layout.chipRotation) this.seatChips[seat].container.setRotation(layout.chipRotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue