[SOLVED] How do change screen orientation in windows 10 uwp?

Get help using Construct 2

Post » Fri Mar 25, 2016 8:51 am

Hi all!

I can't change screen orientation from portrait to landscape and backward in my windows 10 mobile app, when i touch button and go to layout. Browser object not work.
How i can can do this?
B
15
S
6
G
2
Posts: 134
Reputation: 2,824

Post » Fri Mar 25, 2016 7:34 pm

I solved this problem! If you want that your windows 10 universal app toggle from portrait to landscape orientation:

- In construct 2 for lock app in portrait orientation:
On start of layout -> Execute javascript: "Windows.Graphics.Display.DisplayInformation.autoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.portrait;"

- For toggle to landscape orientation:
On start of layout or On touched object -> Execute javascript: "Windows.Graphics.Display.DisplayInformation.autoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.landscape;"

- In visual studio 2015 open package.appxmanifest your app and set in Aplications tab supported rotations - landscape and portraite.
B
15
S
6
G
2
Posts: 134
Reputation: 2,824

Post » Wed May 11, 2016 12:36 pm

Hi. Thanks for the update. But how did you try it before when it did not work?

I just made a test project and used this:
Image

It works fine on preview and on mobile browser but I could not test it in Visual Studio yet cause I have no WinPhone to test it or WinTablet. So my example will not work?
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 762
Reputation: 9,615

Post » Sun Mar 04, 2018 3:32 pm

Bl4ckSh33p wrote:Hi. Thanks for the update. But how did you try it before when it did not work?

I just made a test project and used this:
Image

It works fine on preview and on mobile browser but I could not test it in Visual Studio yet cause I have no WinPhone to test it or WinTablet. So my example will not work?


THANK YOU!!!! canvas size!!!!!!! its workt!!!!!!!!!!!!!!!!!!!!!! :D :D :D :D :D :D :D :mrgreen: :mrgreen: :mrgreen:

change screen orientation landscape portrait its realy worcked!!! thank you so much!!
You need only change canvas size!
B
5
Posts: 3
Reputation: 235


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests