I'm having trouble zooming in and moving my sprites. I made a simple drawing to demonstrate what happens.
No zoom:
Zoomed out:
Some lines disappear, when moving a sprite. If I use a filter, this effect improves, but the image is now blurred.
textureParameter = new TextureLoader.TextureParameter();
textureParameter.genMipMaps = true;
textureParameter.minFilter = Texture.TextureFilter.MipMapLinearLinear;
textureParameter.magFilter = Texture.TextureFilter.Linear;
game.getManager().load(ResourcesString.image, Texture.class, textureParameter);
This is the way I deal with my camera:
//Code
private void zoomCamera(Vector3 origin, float scale){
main.orthographicCamera.update();
Vector3 oldUnprojection = main.orthographicCamera.unproject(origin.cpy()).cpy();
if(scale > zoomMin) scale = zoomMin;
if(scale < zoomMax) scale = zoomMax;
main.orthographicCamera.zoom = scale;
main.orthographicCamera.update();
Vector3 newUnprojection = main.orthographicCamera.unproject(origin.cpy()).cpy();
main.orthographicCamera.position.add(oldUnprojection.cpy().add(newUnprojection.cpy().scl(-1f)));
main.orthographicCamera.update();
}
public void pan(float x, float y, float deltaX, float deltaY) {
main.orthographicCamera.translate(deltaX * -2f, deltaY * 2f);
}
Why do my lines display as uneven when I zoom out, and how do I fix it?