You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 19:41:11 +00:00
Merge branch 'master' of https://github.com/okamstudio/godot.wiki
@@ -15,7 +15,7 @@ To begin with, a tileset needs to be made. Here are some tiles for it. They are
|
||||
|
||||
Create a new project and throw the above png image inside.
|
||||
|
||||
###Create the TileSet
|
||||
###Create the TileSet Scene
|
||||
|
||||
We will be creating a [TileSet](class_tileset) resource. While this resource exports properties, it's pretty difficult to get complex data into it and maintain it:
|
||||
|
||||
@@ -35,7 +35,35 @@ 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.
|
||||
|
||||
<p align="center"><img src="images/tile_example2.png"></p>
|
||||
|
||||
###Collision
|
||||
|
||||
To add collision to a tile, create a StaticBody2D child for each sprite. This is a static collision node. Then, as a child of the StaticBody2D, create a CollisionShape2D or CollisionPolygon. The later is recommended because it's easier to edit:
|
||||
|
||||
<p align="center"><img src="images/tile_example3.png"></p>
|
||||
|
||||
Finally, edit the polygon, this will give the tile a collision. **Remember to use snap!**. Using snap will make sure collision polygons are aligned properly, allowing a character to walk seamlessly from tile to tile.
|
||||
|
||||
<p align="center"><img src="images/tile_example4.png"></p>
|
||||
|
||||
Keep adding collisions to tiles untile we are done. Note that BG is just a BG so we don't care about it.
|
||||
|
||||
<p align="center"><img src="images/tile_example5.png"></p>
|
||||
|
||||
OK! We're done! remember to save this scene for future edit, call it "tileset_edit.scn" or something like that.
|
||||
|
||||
###Exporting a TileSet
|
||||
|
||||
With the scene created and opened in the editor, next step will be to create a tileset. Use Scene > Convert To > Tile Set from the Scene Menu:
|
||||
|
||||
<p align="center"><img src="images/tileset_export.png"></p>
|
||||
|
||||
Then choose a filename, like "mytiles.res". Make sure the "Merge With Existing" option is toggled on. This way, every time the tileset resource file is overwritten, existing tiles are merged and updated (they are referenced by their unique name, so again, **name your tiles properly**).
|
||||
|
||||
<p align="center"><img src="images/tileset_merge.png"></p>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user