Use full screen

This commit is contained in:
Peter Stockings
2026-01-04 09:44:05 +11:00
parent 64118090d6
commit ad487e766c
4 changed files with 51 additions and 14 deletions

View File

@@ -16,7 +16,13 @@ export class SplashScene extends Scene {
// Background (Placeholder for Image)
// If we successfully load the image 'splash', we use it.
if (this.textures.exists('splash')) {
this.add.image(width / 2, height / 2, 'splash').setDisplaySize(width, height);
const splash = this.add.image(width / 2, height / 2, 'splash');
// Scale to cover the screen while maintaining aspect ratio
const scaleX = width / splash.width;
const scaleY = height / splash.height;
const scale = Math.max(scaleX, scaleY);
splash.setScale(scale);
} else {
this.add.rectangle(0, 0, width, height, 0x110022).setOrigin(0);
this.add.text(width/2, height/2, "ROGUE LEGACY", {