buttonsgens.gd 520 B

12345678910111213141516171819202122
  1. extends Node2D
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. var button = preload("res://ui/Button.tscn")
  6. # Called when the node enters the scene tree for the first time.
  7. func _ready():
  8. for i in 5:
  9. var button2 = button.instance()
  10. add_child(button2)
  11. button2.initpos = global_position
  12. button2.initpos.y += i * 72
  13. button2.initpos.x += 270
  14. pass # Replace with function body.
  15. # Called every frame. 'delta' is the elapsed time since the previous frame.
  16. #func _process(delta):
  17. # pass