style: move fullscreen button to top-left corner
This commit is contained in:
@@ -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.';
|
const shootMessage = this.isMobile ? 'Hunt whales! Tap to shoot harpoon.' : 'Hunt whales! Click or press SPACE to shoot harpoon.';
|
||||||
this.showMessage(shootMessage);
|
this.showMessage(shootMessage);
|
||||||
|
|
||||||
// Fullscreen button (positioned to avoid HUD)
|
// Fullscreen button
|
||||||
createFullscreenButton(this, { x: 30, y: 580 });
|
createFullscreenButton(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import { fontSize } from './responsive.js';
|
|||||||
* Create a fullscreen toggle button in the corner of the screen
|
* Create a fullscreen toggle button in the corner of the screen
|
||||||
* @param {Phaser.Scene} scene - The Phaser scene to add the button to
|
* @param {Phaser.Scene} scene - The Phaser scene to add the button to
|
||||||
* @param {object} options - Optional configuration
|
* @param {object} options - Optional configuration
|
||||||
* @param {number} options.x - X position (default: 770)
|
* @param {number} options.x - X position (default: 30)
|
||||||
* @param {number} options.y - Y position (default: 580)
|
* @param {number} options.y - Y position (default: 20)
|
||||||
*/
|
*/
|
||||||
export function createFullscreenButton(scene, options = {}) {
|
export function createFullscreenButton(scene, options = {}) {
|
||||||
const x = options.x || 770;
|
const x = options.x || 30;
|
||||||
const y = options.y || 580;
|
const y = options.y || 20;
|
||||||
|
|
||||||
// Button background
|
// Button background
|
||||||
const btn = scene.add.rectangle(x, y, 50, 30, 0x000000, 0.6);
|
const btn = scene.add.rectangle(x, y, 50, 30, 0x000000, 0.6);
|
||||||
|
|||||||
Reference in New Issue
Block a user