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.';
|
||||
this.showMessage(shootMessage);
|
||||
|
||||
// Fullscreen button (positioned to avoid HUD)
|
||||
createFullscreenButton(this, { x: 30, y: 580 });
|
||||
// Fullscreen button
|
||||
createFullscreenButton(this);
|
||||
}
|
||||
|
||||
update() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user