Android Anyone with tips/pitfalls for dealing with mobile device "notches"?

Discussion in 'Programming' started by Justice, Jan 10, 2019.

  1. Justice

    Justice Member

    Joined:
    May 8, 2017
    Posts:
    412
    I don't have a phone with a notch, hole punch, etc. Does anyone who has dealt with this have any tips or pitfalls specific to GMS2? Even just the basics---do GML's gui/display functions return the resolution you see advertised for the phone, do attempts to draw over it "work" as in not crash, is there any way to detect that the phone has a dead area like that?
     
  2. Justice

    Justice Member

    Joined:
    May 8, 2017
    Posts:
    412
    I've been looking at this more. Android Virtual Devices running Pie can simulate a tall single notch, a corner hole-punch, and top-and-bottom notches. When these are enabled, GMS2's get_display functions simply return a smaller display height and the game simply acts as if the display were the size of the screen less the vertical space of the notches. This results in a black-bar effect, except you can't overwrite it using the GUI functions the way that you can with aspect-ratio black bars.

    According to this article, the Android API provides a function to use the full screen space excepting only the notch area itself. GMS2 doesn't have functionality to do this, though. I'll submit a feature request and I'm sure YYG will update GMS2 promptly to keep up with Android and modern devices.

    Edit: The last sentence was sarcasm, for any prospective users of the mobile export.
     
  3. PartTimeCrazy

    PartTimeCrazy Member

    Joined:
    Mar 24, 2017
    Posts:
    7
    Just a heads up it looks like the iPad Pro problem I was having is a bug and I wasn't going mad.
     
  4. RefresherTowel

    RefresherTowel Member

    Joined:
    Jul 13, 2016
    Posts:
    985
    You can find extensions to allow your to change the shape of your game window (for instance, if you wanted a circular window rather than a rectangular one). Perhaps look at some of those.
     

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