I add buttons in script to grid container which works a bit.
I can't resize the buttons with no margin- I know it is related to grid container but no settings make a difference
I need a border for the buttons.
Somehow the first button has text set to 9- how to set it 1- simplest way. Thanks in advance.
Here is the main code
extends Node
# Called when the node enters the scene tree for the first time.
func _ready():
for l in 9:
for k in 3:
for j in 9:
for i in 3:
var tile=Button.new()
add_child(tile)
tile.rect_min_size(Vector2(40,40))
tile.text=str(k*3+(i+1))
tile.connect("pressed", self, "ButtonPressed")
tile.set_script(preload("res://tiledetails.gd"))
# tile.tiledetails.x=k*3+(i+1)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass