Automatically replacing tiles with nodes works now completely

This commit is contained in:
2022-11-15 20:16:04 +01:00
parent 36fe0f1f08
commit dd6bad8600
3 changed files with 15 additions and 9 deletions

View File

@@ -5,11 +5,6 @@ using System.Linq;
public class tilemap_foreground : TileMap
{
public override void _Process(float delta)
{
}
public override void _Ready()
{
ReplaceStaticTiles(1, "debug_tile_one");
}
@@ -25,7 +20,7 @@ public class tilemap_foreground : TileMap
var instance = scene.Instance();
AddChild(instance);
var node = GetNode<Node2D>(instance.GetPath());
node.Position = allCells[i]; //position changes but doesn't change visible ingame
node.Position = allCells[i] * CellSize; //node has to be 2D and can't be centered
GD.Print(node);
}
}