Would it be possible to lock the screen rotating on mobile?

I want my project to be played at landscape, but if the user didnt lock the screen rotating it will automatically rotating and causing wrong scaling,

it is possible to lock the rotating and force landscape or portrait?

Unfortunately not. There’s no browser API to lock the rotation.

You can detect if the user has the phone in the wrong orientation and pause the game, enable an overlay to orient the device in the correct orientation.

I think there is an API to lock screen orientation:

https://caniuse.com/#feat=screen-orientation

But it’s not available on iOS.

1 Like

I stand corrected, I didn’t realise that it existed

1 Like