Files
godot-demo-projects/misc/pause/pause_button.gd
Voylin 8793b7117f Fixing Pause Demo - Object not rotating + 4.0 changes
Fixes #700

Update misc/pause/spinpause.tscn

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Update misc/pause/spinpause.tscn

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Small fixes
2022-04-03 14:16:28 +09:00

19 lines
528 B
GDScript

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.
process_mode = Node.PROCESS_MODE_ALWAYS
func _toggled(is_button_pressed):
# Pause or unpause the SceneTree based on whether the button is
# toggled on or off.
get_tree().paused = is_button_pressed
if is_button_pressed:
text = "Unpause"
else:
text = "Pause"