How do I rotate only buttons when switching orientations?

0 favourites
  • 6 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • Hi folks,

    I'm trying to create a game that can be played both in portrait mode and in landscape mode on Android. The thing is, when switching orientation, only certain elements should rotate. I've tried to set the project setting Orientations to Any as well as to Portrait, and then use the Browser Is Landscape/Portrait event to rotate the buttons, but it seems I can only either rotate the whole screen or nothing at all.

    Am I close?

  • Try to lock the orientation and use the "browser" object. There is a condition for mobile orientation. (not tested).

    Which runner (webviewer) are you using?

  • Try to lock the orientation and use the "browser" object. There is a condition for mobile orientation. (not tested).

    Which runner (webviewer) are you using?

    I will look some more into it, haven't found a solution yet.

    What do mean with webviewer? I'm testing this on an Android device after exporting from Intel XDK.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try this. It works for me:

    • Make two layouts: landscape an portrait. Both with the same event sheet.
    • Add the object "Browser"
    • Add to the event sheet the following conditions (Browser) and actions (System - go to layout):
    • Browser > Is Portrait --- System > go to portrait
    • Browser > Is Landscape ---- System > go to landscape
  • Try this. It works for me:

    - Make two layouts: landscape an portrait. Both with the same event sheet.

    - Add the object "Browser"

    - Add to the event sheet the following conditions (Browser) and actions (System - go to layout):

    - Browser > Is Portrait --- System > go to portrait

    - Browser > Is Landscape ---- System > go to landscape

    Ah, why didn't I think of that? Great idea, thanks a lot!

  • Actually, maybe I was a bit too quick there. How do you make sure positions of objects on screen etc are saved when switching between orientations? I'm not sure Persist will work for me.

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