feat: add fullscreen mode toggle button
- Add src/utils/fullscreen.js with createFullscreenButton() helper - Fullscreen button appears in bottom-right corner of all scenes - Click to toggle fullscreen mode - Uses Phaser's built-in scale manager Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Phaser from 'phaser';
|
||||
import { fontSize } from '../utils/responsive.js';
|
||||
import { createFullscreenButton } from '../utils/fullscreen.js';
|
||||
|
||||
export default class HuntingScene extends Phaser.Scene {
|
||||
constructor() {
|
||||
@@ -47,6 +48,9 @@ export default class HuntingScene extends Phaser.Scene {
|
||||
// Message display
|
||||
const shootMessage = this.isMobile ? 'Hunt whales! Tap to shoot harpoon.' : 'Hunt whales! Click or press SPACE to shoot harpoon.';
|
||||
this.showMessage(shootMessage);
|
||||
|
||||
// Fullscreen button (positioned to avoid HUD)
|
||||
createFullscreenButton(this, { x: 30, y: 580 });
|
||||
}
|
||||
|
||||
update() {
|
||||
|
||||
Reference in New Issue
Block a user