Hi everyone, I’m struggling to get a single background Sprite to cover the entire screen on all aspect ratios (full-bleed), like CSS background-size: cover, without visible borders.
What I have
Project viewport: 1080x1920 (portrait)
Background object: Sprite on a dedicated layer named Background
Layer parallax: 0,0 (I also tried 100,100)
I’m resizing the sprite to “cover” using this formula (works mathematically):
On start of layout (and same on resized):
Set bgW = BG_Egypt.ImageWidth
Set bgH = BG_Egypt.ImageHeight
BG_Egypt Set position to (ViewportMidX("Background"), ViewportMidY("Background"))
BG_Egypt Set size to ( bgW * max(ViewportWidth("Background")/bgW, ViewportHeight("Background")/bgH), bgH * max(ViewportWidth("Background")/bgW, ViewportHeight("Background")/bgH) )
Debug logs
Example log values:
VW=1334.23 VH=1920
BGW=1334.23 BGH=2001.35
So the sprite is larger than the viewport in one dimension (expected for cover), but I still see borders/letterboxing around the game area in preview / device emulation.
Questions
Is the correct solution to set Project → Viewport fit = Cover (instead of Auto) to avoid letterboxing entirely?
Should the background layer parallax be 0,0 or 100,100 for a fixed background with camera?
If Browser → Request fullscreen is triggered on On start of layout, it often fails due to user gesture restrictions. Could that cause letterboxing in preview even if scaling is correct?
What is the recommended “best practice” to ensure a single background image covers the entire screen on mobile (Android/iOS/Web)?
Any guidance or a minimal example would be appreciated.