Figuring out device resolution

I'm trying to create a Universal Build app that will play with no black bars on any device. I want to change the position of the HUD elements and the boundry of the characters movements based on the screen size of the device - since I programmically move them IF I know the screen size of the device - or at least, make rules for the most used devices.

But my problem is... I can't seem to find an attribute that corresponds to the actually screen size. I'm testing the code on an Android Samsung S5 and no matter what variable I use... game.devices.screen.size.height/width returns 1024x768 (I built for a iPad)... and game.display size.height/width returns 1024x768.

Is there any attribute that will return the actual device resolution?

Comments

  • LovejoyLovejoy Member Posts: 2,078

    @ookami007 this may help

    Fortuna Infortuna Forti Una

  • ookami007ookami007 Member Posts: 581
    edited March 2015

    @Lovejoy - Thanks... has anyone gotten this technique working on the PC version of GS with Android?

    When I run the app and display text the values you use to calculate it... I'm getting 1024 x 768... NOT the resolution on my phone... 1920x1080...

  • ookami007ookami007 Member Posts: 581
    edited March 2015

    Just did a test... I did a constrain attribute for device.screen.size.width/height... and displayed it on my Android device... it says 1024 x 768.

    So, I'm assuming this is another case where GS PC is FAR, FAR, FAR, FAR behind GS Mac.

    It's almost like it's not even the same product.

    So basically, on the PC version... there is no way to tell what the resolution is on the device and no way to adjust things accordingly.

    Total BS.

  • jigglybeanjigglybean Member Posts: 1,584

    The PC version is far behind. The pros though, it has a much better UI than the Mac version (which the mac will be changing to). The problem with Android is that there's just so many different screen sizes it makes it a needle in a haystack sometimes.

    Just design for the most popular and see how you get on

    Like Balls? Then click here! We've 100 coming soon

  • ookami007ookami007 Member Posts: 581

    The problem is... I have NO way of knowing what resolution I'm looking at... so consequently... I'm forced to design a flawed and inferior game because GS doesn't actually work the way it should.

Sign In or Register to comment.