main.gd 751 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. extends Panel
  2. # member variables here, example:
  3. # var a=2
  4. # var b="textvar"
  5. func _ready():
  6. # Initialization here
  7. pass
  8. func _goto_scene():
  9. var s = load("res://controls.scn")
  10. var si = s.instance()
  11. get_parent().add_child(si)
  12. queue_free()
  13. pass
  14. func _on_system_pressed():
  15. #will autodetect based on system, then fall back
  16. #to english if not found
  17. _goto_scene()
  18. #NOTE: Changling locale will not change the text in the controls,
  19. # The scene must be reloaded for changes to take effect.
  20. func _on_english_pressed():
  21. TranslationServer.set_locale("en")
  22. _goto_scene()
  23. func _on_spanish_pressed():
  24. TranslationServer.set_locale("es")
  25. _goto_scene()
  26. func _on_japanese_pressed():
  27. TranslationServer.set_locale("ja")
  28. _goto_scene()