style: move fullscreen button to top-left corner

This commit is contained in:
Thomas Richter
2026-02-05 00:10:16 +01:00
parent be41f912a2
commit f2be8ca3d0
2 changed files with 6 additions and 6 deletions

View File

@@ -49,8 +49,8 @@ export default class HuntingScene extends Phaser.Scene {
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 });
// Fullscreen button
createFullscreenButton(this);
}
update() {

View File

@@ -6,12 +6,12 @@ import { fontSize } from './responsive.js';
* Create a fullscreen toggle button in the corner of the screen
* @param {Phaser.Scene} scene - The Phaser scene to add the button to
* @param {object} options - Optional configuration
* @param {number} options.x - X position (default: 770)
* @param {number} options.y - Y position (default: 580)
* @param {number} options.x - X position (default: 30)
* @param {number} options.y - Y position (default: 20)
*/
export function createFullscreenButton(scene, options = {}) {
const x = options.x || 770;
const y = options.y || 580;
const x = options.x || 30;
const y = options.y || 20;
// Button background
const btn = scene.add.rectangle(x, y, 50, 30, 0x000000, 0.6);