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