Hi,
Currently I just have a tiledmap being rendered onto the screen (which works properly), but when I resize the window, the map keeps flashing between the old position on the screen and the new position. I think the problem has something to do with the Tiled Map Renderer, but I have no idea what the problem is.
This is being called in the resize() method of the screen:
1 2 3 4
| camera.viewportWidth = width; camera.viewportHeight = height; camera.update(); |
This is in the render() method:
1 2 3
| camera.update(); level.render(camera); |
This is the render method in the Level class:
1 2 3 4 5 6
| public void render(OrthographicCamera camera) { if(mapLoaded) { renderer.setView(camera); renderer.render(); } } |
1
| renderer = new OrthogonalTiledMapRenderer(map); |
and
1 2
| camera = new OrthographicCamera(); camera.projection.set(camera.combined); |
are called before the Level is created.