libgdx - Showing as much of a TiledMap as screen allows -


i have simple 20 x 20 tile world (tiledmap) want display using orthogonaltiledmaprenderer. however, i'd show of world screen allow. means if screen bigger, more of world shown , if screen smaller, less of world shown. is possible?

the physical size of tiles 16 pixels x 16 pixels. thought creating 16 * 20 x 16 * 20 (320 x 320 unit?) fillviewport trick, show entire world on screen (zooming in or out depending on screen size). instead want zoom stay @ 1 , cut off world wide or tall screen. how can achieve effect?

update

i tried using screenviewport, ends looking this: enter image description here.

i've tried setting camera's position so: camera.position.set(viewport.getworldwidth() / 2, viewport.getworldheight() / 2, 0); in create method, camera's position 0, 0, 0.

here source code using far.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -