Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Good day. First of all, some explanation of situation.

Init tiled map code:

map = new TmxMapLoader().load("maps/map.tmx");
mapRenderer = new OrthogonalTiledMapRenderer(map, 1f / 32f);

Rendering code:

mapRenderer.setView(cam);
mapRenderer.render();

The problem. I have square map and non-square screen. Map fills whole screen. Because of that map scales incorrectly (32x32 cells transform to 32x40 cells according to X and Y scaling of screen). How can I render map without filling whole screen?

Thanks.

share|improve this question
    
What is your camera code? You should be using an OrthographicCamera. –  petervaz Jun 14 '13 at 16:49
    
cam = new OrthographicCamera(MyWorld.CAMERA_WIDTH, MyWorld.CAMERA_HEIGHT); –  Alex Jun 14 '13 at 17:00
    
are you calling camera.update() before the render? If not, try that. –  petervaz Jun 14 '13 at 17:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.