Reputation: 3965
I'm creating a simple 2d game using the Godot engine. I'm having trouble with the TileMap
object. Here's what my Scene Tab looks like.
A Scene_One
node is the parent of a single child TileMap
node. When I click on the TileMap node, the Inspector window opens up:
By default, the values of the Cell properties are 64
x, 64
y. My sprite is is too small for the grid. Here's a good look at the problem.
My images are smaller than what I assume is a 64 x 64 grid. [I don't know if this assumtion is correct.] So, I adjust the values of the Cell size properties in the Inspector for the TileSet to be (16, 16). Now it looks like this:
I save, hit Enter, but when I open up the TileSet Editor, nothing seems to have changed. I've tried this with different combinations of values for x
and y
, but can't seem to adjust the TileSet grid size.
I am a beginner Godot. Can someone please explain what I'm doing wrong? It's driving me crazy.
Edit: I've tried re-importing tileset.png
without a filter, same result.
Upvotes: 1
Views: 2635
Reputation: 150
You need to diferenciate between the cell size of the tilemap (this is grid) and the size of each tile on the tileset.
The tileset looks like a 16x16 so keep that as your cell size, but the tiles have a gap of another 16px between. You will need to set an offset so select the icon with the # and the magnet in the tileset editor
and Snap Options will appear on your inspector. There you can edit your step, offset, and separation. Mess with that and you will eventually get it right.
Upvotes: 1