mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 21:22:48 +00:00
Updated tutorial_tilemap (markdown)
parent
d249aa7d7b
commit
ce0615b42e
@ -25,7 +25,7 @@ There's enough properties to get by, and with some effort editing this way can w
|
||||
|
||||
###TileSet Scene
|
||||
|
||||
Create a new scene with a regular node or node2d as root. For each new a sprite will be added. Since tiles here are 50x50, enabling snap might be a good idea. It is very important that the sprite is either centered ("center" property) or with an offset that refers to the center, because at the time of editing if the tile is mirrored in either X or Y direction, it will be done around this center (for both the image and collision).
|
||||
Create a new scene with a regular node or node2d as root. For each new a sprite will be added. Since tiles here are 50x50, enabling snap might be a good idea.
|
||||
|
||||
If more than one tile is present in the source image, make sure to use the region property of the sprite to adjust which of the sprites is the source texture is being edited.
|
||||
|
||||
@ -35,7 +35,7 @@ Sounds like a lot of requirements, so here's a screenshot that shows where every
|
||||
|
||||
<p align="center"><img src="images/tile_example.png"></p>
|
||||
|
||||
Continue adding all the tiles, adjust the offsets if needed (if you use multiple tiles in a single image) unless there is a sprite per each tile. Again, as always, remember they have to be centered and their names must be unique.
|
||||
Continue adding all the tiles, adjust the offsets if needed (if you use multiple tiles in a single image) unless there is a sprite per each tile. Again, as always, remember that their names must be unique.
|
||||
|
||||
<p align="center"><img src="images/tile_example2.png"></p>
|
||||
|
||||
@ -81,6 +81,26 @@ Also set the cell size to '50', since that is the size used by the tiles. Quadra
|
||||
|
||||
With all set, make sure the TileMap node is selected. A red grid will appear on screen, allowing to paint on it with the selected tile on the left pallete.
|
||||
|
||||
<p align="center"><img src="images/tile_example5.png"></p>
|
||||
|
||||
To avoid moving and selecting the tilemap node accidentally (something common given it's a huge node), it is recommended that you lock it, using the lock button:
|
||||
|
||||
<p align="center"><img src="images/tile_lock.png"></p>
|
||||
|
||||
###Scaling Artifacts
|
||||
|
||||
When using a single texture for all the tiles, scaling the tileset (or even moving to a non pixel-aligned location) will most likely result in filtering artifacts like this:
|
||||
|
||||
<p align="center"><img src="images/tileset_filter.png"></p>
|
||||
|
||||
This can't be avoided, as it is the way the hardware bilinear filter works. So, to avoid this situation, there are a few workarounds:
|
||||
|
||||
* Disable filtering for either the tileset texture or the entire image loader (see the [Image Files](image_files) asset pipeline tutorial).
|
||||
* Use a single image for each tile.
|
||||
* Viewport Scaling can often helps shrinking the map (see the [Viewports](tutorial_viewports) tutorial).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user