Screen resolution difficulties

edited in Questions and Answers
Hey there, my apologies if question is asked previously, I cannot locate.
I am having trouble finding info on this...
I have semi finished an android game. Only prob is when I tested it on 3 different phones the ratio and button layout and input was all askew. None were in the same spot as it was on my pc. I am using libgdx. How do I go about standardizing the screen resolution on multiple phones with different screen sizes?

Thanks a ton.
Dragonball z!

Comments

  • This is always a thorny problem.

    The basic logic here is to build in systems that are aware of the current screen size and aspect ratio. You're probably going to want to set your in-game camera to use the vertical height aspect so that things don't look stretched or compressed on different screen ratios (and vertical height tends to drive that effect, it doesn't really matter much if more or less stuff is visible on the sides of your screen). Or you'll need to implement black/filler bars when your game doesn't match the screen ratio that someone's playing at.

    As far as interface construction goes, you're going to want to always constrain your interface to be relative to screen edges. Think in terms of positioning things in the top-left or bottom-right corner + some offset vector instead of via direct co-ordinates. And if you're doing any back projection to make interface elements hover over in-game assets, be sure to take the changed aspect ratio into account. You have to keep those things dynamic if you want them to survive on different screen ratios and sizes ;)
  • Thanks a ton for replying man!
    I ujst watched a tutorial (one of the very few out there) and they were going on about layout xml files. Would this apply to me too regarding interface buttons, sprites and backrounds?
  • Hey Boss, some of the GUI solutions will do this for you auto-magically. I assume UNITY?
  • LIBGDX.

    Here's the problem as it stands...

    I have made a basic game. Landscape, background, sprites, and buttons UI. Now i figured i should try it out on a phone. Tried it on Galaxy 3. Worked and had same layout as desktop. Tried on S3 mini, same layout. Then my nightmare began. I tried it on a galaxy GIO Lay out was diff. There was something sticking out the bottom of the screen unlike the rest. O ya, the button UI on the 3 diff devices was a lil off. On the desktop id click on y = 50 (lets say) and it wouldplay. On the phone the button pic would be a lil higher and the actual listener for the UI was below it. and the next phone same thing but even further and on the GIO just anarchy.

    Also i was playing around with just drawing a background to the screen (just a blue plain) and it was fine on the desktop but on the s3 mini it was like half the screen and black on top but the screen (width wise) was auto stretched.

    That's it man. That's my wall right now and i am really struggling to find a solution. I just don't know what to do and i'm a beginner so jargon hasn't helped me too.
  • I don't know the LIBGDX framework. It sounds like a common situation so I am sure you can google the answers?
    Have you tried UNITY?
  • Not yet. Does unity have a clear cut answer for such an issue?
Sign In or Register to comment.