Advertisement
Guest User

Untitled

a guest
Aug 6th, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. # The commands of the titlescreen
  2.  
  3. extends Control
  4.  
  5. var scene_path_to_load
  6.  
  7. func _ready():
  8. $Menu/CenterRow/Buttons/campaignButton.grab_focus()
  9. for button in $Menu/CenterRow/Buttons.get_children():
  10. button.connect("pressed", self, "_on_Button_pressed", [button.scene_to_load])
  11.  
  12. func _on_Button_pressed(scene_to_load):
  13. scene_path_to_load = scene_to_load
  14. $FadeIn.show()
  15. $FadeIn.fade_in()
  16.  
  17.  
  18. func _on_FadeIn_fade_finished():
  19. get_tree().change_scene(scene_path_to_load)
  20.  
  21. # The commands of the associated windows to get back to the titlescreen----------------------------------------------------------------
  22.  
  23. extends Control
  24.  
  25.  
  26. func _on_Button_pressed():
  27. get_tree().change_scene('res://title_screen/TitleScreen.tscn')
  28.  
  29. extends Label
  30.  
  31.  
  32. func _on_Button_pressed():
  33. get_tree().change_scene('res://title_screen/TitleScreen.tscn')
  34.  
  35. # Thats a String, which you can also find in the script of the titlescreen to get to the associate windows-----------------------------
  36.  
  37. extends Button
  38.  
  39. export(String) var scene_to_load
  40.  
  41. # Thats of the animation which I use as a crossing by pressing the titlescreen button--------------------------------------------------
  42.  
  43. extends ColorRect
  44.  
  45. signal fade_finished
  46.  
  47. func fade_in():
  48. $AnimationPlayer.play("fade_in")
  49.  
  50.  
  51. func _on_AnimationPlayer_animation_finished(anim_name):
  52. emit_signal("fade_finished")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement