Search code examples
androidlibgdx2dviewport

libgdx Viewports - Why when I use FitViewport the touch input x and y is not accurate?


libgdx Viewports - Why when I use FitViewport the touch input x and y is not accurate? enter image description here


Solution

  • Use viewport.unproject() instead of camera.unproject() so the cropping of the FitViewport is taken into acount.