Android Change Device Orientation?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Raonak, Sep 28, 2019.

  1. Raonak

    Raonak Member

    Joined:
    Sep 28, 2019
    Posts:
    7
    Hi, i'm developing a game for android, and am wondering if there's any way to change the device orientation?

    I know you can uncheck orientations in the configuration menu... but my game supports both landscape and portrait, and in the case where the user has locked the orientation through the OS, is there a way to grammatically change the orientation?

    e.g. User has locked the phone orientation to portrait, but wants to play the game in landscape.

    is there some equivalent of os_set_orientation()?
     
  2. Greenwitch

    Greenwitch Member

    Joined:
    Aug 30, 2019
    Posts:
    28
    Landscape is just 'portrait' but rotated. To set a mobile game landscape, you just treat portrait as if it was landscape and just draw your game in that manner, a.k.a simply rotated to whichever side you want it at. You'd then make your own function that acts as a 'switch' between these modes.
     
  3. Raonak

    Raonak Member

    Joined:
    Sep 28, 2019
    Posts:
    7
    Cool, i think i can manage that with view rotate. But do you know if there's any way of changing gui rotation? That's gonna be the hard part...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice