Resize tile in TileMap?

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

Hi, i’m new to Godot and game development in general so this might be kind of a beginner question. I’m trying to build my level out of a single TileMap node, but the Sprite i have is too big for the TileMap cell. The collision and everything works, i just can’t find the Scale property on the TileMap inspector. Even making the single Tile separately in a different scene and scaling it, it’s still the same size when i import it as a TileSet. Help?

:bust_in_silhouette: Reply From: njamster

Have you read this part of the documentation? You can define the cell size by selecting your TileMap-node in the scene tree, unfolding the section called “Cell” in the property inspector and setting the size to the value you desire.

Yes, i’ve read that. My problem is that i want a specific size for my tiles, and the sprite is bigger than the grid cells. I don’t need to make the cells bigger, i need to make the sprites smaller

hamburger | 2020-04-16 06:57

There is no scale-property for tiles. If your sprites are bigger than your cell-size, rescale them with the image editor of your choice.

njamster | 2020-04-16 11:18

First, set the cell size within the tilemap to be the same size as the actual images for each of your tiles. Then, in the Node2D properties for the tilemap, change the scale and that will change the actual scale of the tilemap and resize your tile images with that. Hope this helps if you didn’t already find an answer!

DucksIncoming | 2022-04-07 17:52

:bust_in_silhouette: Reply From: ScorpioneOrzion

Create an extra texture that is the size of your TileMap cell.
Make a single tile from that texture, then add a shader to that tile with the following shader.

shader_type canvas_item;
uniform sampler2D Sprite;

void fragment() {
  COLOR = texture(Sprite, UV);
}

Next you just have to set the texture you want to use in the shader param Sprite

:bust_in_silhouette: Reply From: LordMatesian

You have it under the Cell setting