I have few questions regarding using libgdx viewport.
1) If you are working with a virtual screen size, you will use virtual sizes for your sprites to draw them. If you use a FitViewport
with 800x480 size and render a Sprite of (virtual) size 800x480 (you supply these values to the SpriteBatch
), then it will fill the whole screen, even if the actual screen would be 1600x960.
2) A Viewport
manages the Camera.viewportWidth
and camera.viewportHeight
for you, based on the strategy that you chose for the Viewport
. You can set it yourself, but when you do Viewport.update(...)
or Viewport.apply()
, the values of your camera will be overridden.