1
\$\begingroup\$

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

http://pastebin.com/rgKgHskN

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

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\begingroup\$ This is almost it but the top half part of the map won't render. \$\endgroup\$
    – Lisible
    Commented May 21, 2014 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .