Skip to content

Commit

Permalink
Added toggle fullscreen button to pause menu
Browse files Browse the repository at this point in the history
  • Loading branch information
telmotrooper committed Jun 24, 2021
1 parent 2864e2e commit 7fad76f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions my-3d-squash-the-creeps/Main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ margin_right = 224.0
margin_bottom = 72.0
text = "Resume"

[node name="ToggleFullscreenButton" type="Button" parent="UserInterface/Pause/HBoxContainer"]
margin_right = 12.0
margin_bottom = 37.0
text = "Toggle Fullscreen"

[node name="ExitButton" type="Button" parent="UserInterface/Pause/HBoxContainer"]
margin_top = 82.0
margin_right = 224.0
Expand Down Expand Up @@ -247,5 +252,6 @@ transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 3.5,
[connection signal="hit" from="Player" to="." method="_on_Player_hit"]
[connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"]
[connection signal="pressed" from="UserInterface/Pause/HBoxContainer/ResumeButton" to="UserInterface/Pause" method="_on_ResumeButton_pressed"]
[connection signal="pressed" from="UserInterface/Pause/HBoxContainer/ToggleFullscreenButton" to="UserInterface/Pause" method="_on_ToggleFullscreenButton_pressed"]
[connection signal="pressed" from="UserInterface/Pause/HBoxContainer/ExitButton" to="UserInterface/Pause" method="_on_ExitButton_pressed"]
[connection signal="body_entered" from="Boundary" to="Boundary" method="_on_Boundary_body_entered"]
4 changes: 4 additions & 0 deletions my-3d-squash-the-creeps/Pause.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ func _on_ResumeButton_pressed():

func _on_ExitButton_pressed():
get_tree().quit()

func _on_ToggleFullscreenButton_pressed():
OS.window_fullscreen = !OS.window_fullscreen
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

0 comments on commit 7fad76f

Please sign in to comment.