How can i separate these tiles?

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

These tiles should be separated (have a margin of space, not be sticked to the others around and this only applies when the letters are in the box) to fit into the hud i’m gonna incorporate into the game.
This is the code:

func _ready():
	randomize()
	for i in range(4):
		for j in range(4):
			var tile:LetterTile = Letter.instance()
			$LetterBox.add_child(tile)
			tile.connect("tile_clicked", self, "on_tile_clicked", [tile])
			tile.position = Vector2(i * TILESIZE, j * TILESIZE)
			tile.box_position = tile.position

What kind of node is $LetterBox ?

Merlin1846 | 2020-11-17 19:03

Letterbox it’s a node2d.

Gonz4 L | 2020-11-17 19:14

:bust_in_silhouette: Reply From: Gonz4 L
tile.position = Vector2(i * TILESIZE, j * TILESIZE) + Vector2(4 * i, 4 * j)