graph_node.gd 500 B

1234567891011121314151617
  1. extends GraphNode
  2. # Called when the node enters the scene tree for the first time.
  3. func _ready() -> void:
  4. var titlebar = self.get_titlebar_hbox()
  5. var btn = Button.new()
  6. btn.text = "?"
  7. btn.connect("pressed", Callable(self, "_open_help").bind("help_pressed")) #pass key (process name) when button is pressed
  8. titlebar.add_child(btn)
  9. # Called every frame. 'delta' is the elapsed time since the previous frame.
  10. func _process(delta: float) -> void:
  11. pass
  12. func _open_help(key: String):
  13. print(key)