fix: button depth 100 to stay above cards, fix inactive text color

This commit is contained in:
kevin.lhereec committed 2026-08-17 12:04:01 +02:00
1 parent 2b37d8167f
commit ec5a7ec2c3
1 file changed
+11 -11
+11 -11
View File
@@ -141,12 +141,12 @@ export class GameScene extends Phaser.Scene {
fontSize: '17px',
fontFamily: 'Georgia',
fontStyle: 'bold',
color: '#1a0a00',
color: '#a08060',
padding: { x: 28, y: 10 }
})
.setOrigin(0.5)
.setAlpha(0.3)
.setDepth(10)
.setAlpha(1)
.setDepth(100)
.setInteractive({ cursor: 'pointer' })
.on('pointerdown', this._playSelectedCard, this)
.on('pointerover', () => { if (this._canPlay && this.selectedCard) this.playBtn.setScale(1.05) })
@@ -157,7 +157,7 @@ export class GameScene extends Phaser.Scene {
fontSize: '12px',
fontFamily: 'Georgia',
color: '#a08060'
}).setOrigin(0.5).setDepth(10)
}).setOrigin(0.5).setDepth(100)
}
_drawBtnBg(active) {
@@ -176,18 +176,17 @@ export class GameScene extends Phaser.Scene {
this.playBtnBg.lineStyle(2, 0xffd700)
this.playBtnBg.strokeRoundedRect(width / 2 - btnW / 2, btnY - btnH / 2, btnW, btnH, 8)
}
this.playBtnBg.setDepth(9)
this.playBtnBg.setDepth(99)
}
_activateBtn() {
this._drawBtnBg(true)
this.playBtn.setAlpha(1).setColor('#1a0a00')
// Animation pulse
// Texte sombre sur fond doré
this.playBtn.setColor('#1a0a00').setAlpha(1)
if (this._pulseTween) this._pulseTween.stop()
this._pulseTween = this.tweens.add({
targets: this.playBtn,
scaleX: 1.04,
scaleY: 1.04,
targets: this.playBtnBg,
alpha: 0.85,
duration: 600,
yoyo: true,
repeat: -1,
@@ -197,7 +196,8 @@ export class GameScene extends Phaser.Scene {
_deactivateBtn() {
this._drawBtnBg(false)
this.playBtn.setAlpha(0.3).setColor('#a08060').setScale(1)
// Texte clair sur fond sombre pour rester lisible
this.playBtn.setColor('#6a5040').setAlpha(1).setScale(1)
if (this._pulseTween) { this._pulseTween.stop(); this._pulseTween = null }
}