feat: add responsive font sizing for mobile
- Add src/utils/responsive.js with fontSize() helper - Mobile fonts scale 1.4x for better readability - Update all scenes to use responsive font sizes - Update deploy-k8s.sh with full deployment steps Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Phaser from 'phaser';
|
||||
import { fontSize } from '../utils/responsive.js';
|
||||
|
||||
export default class HuntingScene extends Phaser.Scene {
|
||||
constructor() {
|
||||
@@ -196,7 +197,7 @@ export default class HuntingScene extends Phaser.Scene {
|
||||
|
||||
// Stats (fixed to screen)
|
||||
this.statsText = this.add.text(20, 15, '', {
|
||||
fontSize: '16px',
|
||||
fontSize: fontSize(16),
|
||||
fill: '#fff'
|
||||
});
|
||||
this.statsText.setScrollFactor(0);
|
||||
@@ -204,7 +205,7 @@ export default class HuntingScene extends Phaser.Scene {
|
||||
// Control mode indicator (fixed to screen, desktop only)
|
||||
if (!this.isMobile) {
|
||||
this.controlModeText = this.add.text(400, 15, 'Controls: MOUSE (TAB to switch)', {
|
||||
fontSize: '16px',
|
||||
fontSize: fontSize(16),
|
||||
fill: '#ffff00'
|
||||
}).setOrigin(0.5, 0);
|
||||
this.controlModeText.setScrollFactor(0);
|
||||
@@ -217,7 +218,7 @@ export default class HuntingScene extends Phaser.Scene {
|
||||
returnBtn.setScrollFactor(0);
|
||||
|
||||
const returnText = this.add.text(750, 30, 'RETURN', {
|
||||
fontSize: '14px',
|
||||
fontSize: fontSize(14),
|
||||
fill: '#fff'
|
||||
}).setOrigin(0.5);
|
||||
returnText.setScrollFactor(0);
|
||||
@@ -239,7 +240,7 @@ export default class HuntingScene extends Phaser.Scene {
|
||||
|
||||
createInstructions() {
|
||||
this.messageText = this.add.text(400, 570, '', {
|
||||
fontSize: '16px',
|
||||
fontSize: fontSize(16),
|
||||
fill: '#fff',
|
||||
backgroundColor: '#000000',
|
||||
padding: { x: 10, y: 5 }
|
||||
|
||||
Reference in New Issue
Block a user