load_threaded.gd 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. extends VBoxContainer
  2. func _on_start_loading_pressed():
  3. ResourceLoader.load_threaded_request("res://paintings/painting_babel.jpg")
  4. ResourceLoader.load_threaded_request("res://paintings/painting_las_meninas.png")
  5. ResourceLoader.load_threaded_request("res://paintings/painting_mona_lisa.jpg")
  6. ResourceLoader.load_threaded_request("res://paintings/painting_old_guitarist.jpg")
  7. ResourceLoader.load_threaded_request("res://paintings/painting_parasol.jpg")
  8. ResourceLoader.load_threaded_request("res://paintings/painting_the_swing.jpg")
  9. for current_button in $GetLoaded.get_children():
  10. current_button.disabled = false
  11. func _on_babel_pressed():
  12. $Paintings/Babel.texture = ResourceLoader.load_threaded_get("res://paintings/painting_babel.jpg")
  13. $GetLoaded/Babel.disabled = true
  14. func _on_las_meninas_pressed():
  15. $Paintings/LasMeninas.texture = ResourceLoader.load_threaded_get("res://paintings/painting_las_meninas.png")
  16. $GetLoaded/LasMeninas.disabled = true
  17. func _on_mona_lisa_pressed():
  18. $Paintings/MonaLisa.texture = ResourceLoader.load_threaded_get("res://paintings/painting_mona_lisa.jpg")
  19. $GetLoaded/MonaLisa.disabled = true
  20. func _on_old_guitarist_pressed():
  21. $Paintings/OldGuitarist.texture = ResourceLoader.load_threaded_get("res://paintings/painting_old_guitarist.jpg")
  22. $GetLoaded/OldGuitarist.disabled = true
  23. func _on_parasol_pressed():
  24. $Paintings/Parasol.texture = ResourceLoader.load_threaded_get("res://paintings/painting_parasol.jpg")
  25. $GetLoaded/Parasol.disabled = true
  26. func _on_swing_pressed():
  27. $Paintings/Swing.texture = ResourceLoader.load_threaded_get("res://paintings/painting_the_swing.jpg")
  28. $GetLoaded/Swing.disabled = true