I'm making a game and I don't know how to resize my TiledMap when the window is bigger but keeping its squared shape.

Here is a screen:

enter image description here

When I change window size, here's what happens: enter image description here

enter image description here

I want to see all the map with all window sizes.

Here's my GameScreen file


Thank you for your help and I'm sorry for those big screenshots and for my english.


LibGDX 1.0 provides what you need : Viewports.

The idea is to work with a known virtual screen size and then have it resized to fit your real screen.

I recommend you to give a look at this tutorial that explains how to handle game screen resizing with Viewports : https://github.com/libgdx/libgdx/wiki/Viewports

| improve this answer | |
  • \$\begingroup\$ This is almost it but the top half part of the map won't render. \$\endgroup\$ – Lisible May 21 '14 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.