mirror of
https://github.com/Relintai/pandemonium_demo_projects.git
synced 2024-12-21 13:56:50 +01:00
19 lines
516 B
GDScript3
19 lines
516 B
GDScript3
|
extends Button
|
||
|
|
||
|
func _ready():
|
||
|
# This ensures that this Node won't be paused, allowing it to
|
||
|
# process even when the SceneTree is paused. Without that it would
|
||
|
# not be able to unpause the game. Note that you can set this through
|
||
|
# the inspector as well.
|
||
|
pause_mode = Node.PAUSE_MODE_PROCESS
|
||
|
|
||
|
|
||
|
func _toggled(button_pressed):
|
||
|
# Pause or unpause the SceneTree based on whether the button is
|
||
|
# toggled on or off.
|
||
|
get_tree().paused = button_pressed
|
||
|
if button_pressed:
|
||
|
text = "Unpause"
|
||
|
else:
|
||
|
text = "Pause"
|