level_button.gd 293 B

1234567891011121314151617181920
  1. @tool
  2. extends TextureButton
  3. @export var level : String :
  4. get:
  5. return get_level()
  6. set(value):
  7. set_level(value)
  8. func get_level():
  9. return $Label.text
  10. func set_level(value):
  11. $Label.text = value
  12. func _on_pressed():
  13. SceneManager.change_to_scene(SceneManager.get_level($Label.text))