• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

SOLVED making game scale to fullscreen in portrait on mobile

Ruimm

Member
Hi all,
I've been trying to scale my game to fullscreen on both desktop and mobile. It seems to work well on desktop browser (and I've also tested on native mobile and the game works well).
However when I try the game from a mobile browser it always runs in landscape mode dispite how I orient my phone. Also the image quality is poor where images are pixelated.

You can try the game here: https://ruim.itch.io/defender

Any one know how I can make the game run in portrait mode? or how to fix the image quality issue?
I'm rather noob when it comes to HTML5, so any help is welcome :)

Thanks
 
If you are in a native browser you will need to respect the orientation of the device.

You can detect the orientation but not force it -


Your best bet is either to make the game scale well for landscape and portrait or just detect if the device is portrait and display a warning message like "Please rotate the screen to play"

Hope this helps!
 

Ruimm

Member
If you are in a native browser you will need to respect the orientation of the device.

You can detect the orientation but not force it -


Your best bet is either to make the game scale well for landscape and portrait or just detect if the device is portrait and display a warning message like "Please rotate the screen to play"

Hope this helps!
I think I didn't explain myself correctly before... sorry about that...
My issue is that the game is entering fullscreen but not respecting the orientation. I have my phone in portrait mode, but when I play the game automatically enters fullscreen in landscape mode. I'd like the game to respect the orientation of the device but it doesn't seem to do it...
BTW:when I try the game on other platforms (mobile + macos) it scales fine to whatever resolution I set it. My issue is just that it always enters fullscreen in landscape, despite the mobile orentation
 

Ruimm

Member
So I got this sorted and it had nothing to do with GM. There is a setting on Itch where you can define the default orientation of your HTML5 game on mobile. If I select "Portrait" it works.
Case closed! :)
 
Top