How do I lock screen orientation in Landscape while using inner or outer scale mode?

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • How can I lock screen in Landscape orientation while using inner or outer scale mode? It works only with letterbox scale...

    Project properties display setting are:

    - Fullscreen mode: Scale inner or Scale outer

    - Orientations: Landscape

    Also I tried to use Browser plugin: lock orientation

    It works only if I use Browser plugin: request fullscreen

  • The very principle of the scaling mode means that the image is expanded to the size of the screen with different options.

    I don't quite understand your need, but I'll make an assumption.

    When I have a horizontal game and smartphone users open it in a browser and hold their smartphone vertically, everything looks terrible.

    I check the aspect ratio in the code, and if it is vertical, I cover the game with a “plug” sprite that prompts the user to rotate their smartphone.

    I also reload the layout when the resolution changes, because I have a lot of positioning of control elements at startup.

    Here is a minimal example.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for advice igortyhon "When I have a horizontal game and smartphone users open it in a browser and hold their smartphone vertically, everything looks terrible." Exactly! That need to be fixed

    "I also reload the layout when the resolution changes, because I have a lot of positioning of control elements at startup." Won’t reloading the layout reset unsaved progress? Why not use the Browser plugin’s On Resize event and call a function to position UI elements? (That function can also be called on start of layout)

    The idea of using a cover is good. I’ll also request fullscreen mode, but that looks like a temporary solution. It would be great to lock the game to horizontal orientation with a 16:9 aspect ratio when a mobile device is in portrait (vertical) mode, use letterbox scaling, and switch to inner or outer scale mode when it’s landscape. Maybe game distribution websites fix this on their side? (I have zero experience with game publishing.)

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