fix: add BOTTOM_MARGIN to avoid Windows taskbar overlap
This commit is contained in:
1 parent
3125823f42
commit
abab58f6a4
1 file changed
+9
-6
@@ -1,6 +1,9 @@
|
||||
import Phaser from 'phaser'
|
||||
import { CardObject } from '../objects/CardObject'
|
||||
|
||||
// Marge depuis le bas du canvas pour éviter la barre Windows
|
||||
const BOTTOM_MARGIN = 60
|
||||
|
||||
// Couleurs équipes (synchronisé avec le serveur)
|
||||
const TEAM_COLORS = {
|
||||
0: 0xcc2200,
|
||||
@@ -88,8 +91,8 @@ export class GameScene extends Phaser.Scene {
|
||||
}).setOrigin(0.5)
|
||||
}
|
||||
|
||||
// Légende attributs (coin en bas à droite)
|
||||
this._buildAttrLegend(width - 10, height - 10)
|
||||
// Légende attributs (coin en bas à droite, au-dessus de la marge Windows)
|
||||
this._buildAttrLegend(width - 10, height - BOTTOM_MARGIN - 10)
|
||||
}
|
||||
|
||||
_buildAttrLegend(x, y) {
|
||||
@@ -111,7 +114,7 @@ export class GameScene extends Phaser.Scene {
|
||||
|
||||
_buildPlayButton() {
|
||||
const { width, height } = this.scale
|
||||
const btnY = height - 28
|
||||
const btnY = height - BOTTOM_MARGIN - 20
|
||||
|
||||
// Fond du bouton (rectangle arrondi via Graphics)
|
||||
this.playBtnBg = this.add.graphics()
|
||||
@@ -134,7 +137,7 @@ export class GameScene extends Phaser.Scene {
|
||||
.on('pointerout', () => { this.playBtn.setScale(1) })
|
||||
|
||||
// Compteur de joueurs prêts (ex: "1 / 2 prêts")
|
||||
this.readyText = this.add.text(width / 2, btnY + 22, '', {
|
||||
this.readyText = this.add.text(width / 2, btnY + 28, '', {
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Georgia',
|
||||
color: '#a08060'
|
||||
@@ -143,7 +146,7 @@ export class GameScene extends Phaser.Scene {
|
||||
|
||||
_drawBtnBg(active) {
|
||||
const { width, height } = this.scale
|
||||
const btnY = height - 28
|
||||
const btnY = height - BOTTOM_MARGIN - 20
|
||||
const btnW = 280
|
||||
const btnH = 42
|
||||
this.playBtnBg.clear()
|
||||
@@ -193,7 +196,7 @@ export class GameScene extends Phaser.Scene {
|
||||
|
||||
if (!cards || cards.length === 0) return
|
||||
|
||||
const handY = height - 120
|
||||
const handY = height - BOTTOM_MARGIN - 110
|
||||
const spacing = Math.min(150, (width * 0.85) / cards.length)
|
||||
const totalW = spacing * (cards.length - 1)
|
||||
const startX = width / 2 - totalW / 2
|
||||
|
||||
Reference in new issue
Block a user