fav_button.gd 321 B

1234567891011121314
  1. extends Button
  2. # Called when the node enters the scene tree for the first time.
  3. func _ready() -> void:
  4. connect("toggled", Callable(self, "_on_toggle"))
  5. # Called every frame. 'delta' is the elapsed time since the previous frame.
  6. func _on_toggle(toggled_on: bool):
  7. if toggled_on:
  8. text = "★"
  9. else:
  10. text = "☆"