Using landscape and portrait in the same project

0 favourites
  • 3 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • I want to display my web project differently on mobile devices from pc. On a pc browser, I want to display a layout that is set in landscape mode, and on mobile, in a portrait mode.

    I already figured out how to lock the project in either landscape mode or portrait mode, depending on the device.

    My problem is though, that in the portrait mode, the project is still displayed in landscape mode, with black bars on top and bottom.

    Is there maybe a way to change the viewport on runtime to match the portrait mode?

    Changing the size settings in the layout did not seem to work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I figured it out myself. If anyone runs into this question, here is what I did to display the two different layouts:

    I created layout 1 (landscape) with all elements arranged matching a landscape mode, and layout 2 (portrait), with the elements matching that. When the project loads, I set the canvas according to the viewport size, but switch the values for width and height. This way, I get portrait on mobile web and landscape on pc web, without having to rotate anything by 90°

  • Hello TinyCrocodile, Your question and then self-answer (haha) helps me alot. Thank you so much, it save my time and my problem is resolved.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)