I have no idea why this happens. But I have the following scenario:
- Rendering a tiled map works fine.
- Rendering the sprites texture region works fine.
- Rendering the shapes of the sprites using a ShapeRenderer works fine
- Unprojecting from the fill viewport works fine.
What doesn't work:
- The box 2d lights when the camera is at the top or at the bottom of the map. (at the bottom they appear a little lower than what they should, and at the bottom, a little higher)
- Unprojecting from the fill camera.
Both issues do not occur when the screen resolution is 1.5. Which is the screen resolution that I use to create the fill viewport.
This is the code that I use to create the camera and the viewport.
fillCamera = new OrthographicCamera(); fillViewport = new FillViewport(Constants.CAMERA_PIXEL_WIDTH, Constants.CAMERA_PIXEL_HEIGHT, fillCamera); fillCamera.position.set(Constants.CAMERA_HALF_PIXEL_WIDTH, Constants.CAMERA_HALF_PIXEL_HEIGHT, 0); fillCamera.update(); public static final float CAMERA_PIXEL_WIDTH = 375F; public static final float CAMERA_PIXEL_HEIGHT = 250F; public static final float CAMERA_HALF_PIXEL_WIDTH = CAMERA_PIXEL_WIDTH / 2; public static final float CAMERA_HALF_PIXEL_HEIGHT = CAMERA_PIXEL_HEIGHT / 2;
What could the issue be?