TileMap is always scaled so tiles are small. Even with a 2D Camera. How to fix?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Robster

Hi all,

As per the title.

If I have a tilemap and I set it to say 20 tiles wide, then it looks good.
The tiles are the correct size on screen.

If I set it to 400 tiles wide, it scales them down to be tiny.

I then add a new 2D Camera and make it default camera but same thing.

How can I make the tilemap show at the correct size?

Thanks so much

UPDATE: Full example with code and problem here : TileMap Godot help - Album on Imgur

Changing the size of a tilemap doesn’t change its scale. You must have something else going on there. Maybe if you share some screenshot(s) of what you’re seeing it may be more apparent how to help you.

kidscancode | 2020-01-02 01:55

try setting camera2D scale less than 1

supper_raptor | 2020-01-02 14:55

Here is all the info:

TileMap Godot help - Album on Imgur

Thanks for taking a look. I’m tearing my hair out :slight_smile:

Robster | 2020-01-02 23:04

:bust_in_silhouette: Reply From: Robster

I found it.

Code was:

var map_size_px := size * _tile_map.cell_size
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, map_size_px)

Code is now:

var map_size_px := Vector2(600,400)
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, map_size_px)

The calc was wrong on the map_size_px

Now I can define it manually and it works.