From fc52ca81f70eb967cb07dc91b960509f221063e0 Mon Sep 17 00:00:00 2001 From: JoNax97 Date: Wed, 11 Jan 2023 10:45:50 -0300 Subject: [PATCH] Update Pausing Games tutorial to match the 4.0 API (#6518) * Update Pausing Games tutorial to match the 4.0 API Some parts of the page were referring to the 3.x API, I've updated them following the observed behavior and API of 4.0beta9 * Apply suggestions from code review Co-authored-by: Hugo Locurcio --- tutorials/scripting/pausing_games.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tutorials/scripting/pausing_games.rst b/tutorials/scripting/pausing_games.rst index 4258b3e9d..fef367699 100644 --- a/tutorials/scripting/pausing_games.rst +++ b/tutorials/scripting/pausing_games.rst @@ -48,25 +48,27 @@ You can also alter the property with code: .. code-tab:: gdscript GDScript func _ready(): - pause_mode = Node.PAUSE_MODE_PROCESS + process_mode = Node.PROCESS_MODE_PAUSABLE .. code-tab:: csharp public override void _Ready() { - PauseMode = Node.PauseModeEnum.Process; + ProcessMode = Node.ProcessModeEnum.Pausable; } This is what each mode tells a node to do: - **Inherit**: Process depending on the state of the parent, grandparent, etc. The first parent that has a non-Inherit state. -- **Pausable**: Stop the node no matter what (and children in Inherit - mode). When paused this node will not process. -- **WhenPaused**: -- **Always**: Process the node no matter what (and children in Inherit - mode). Paused or not this node will process. -- **Disabled**: The node will not process at all. +- **Pausable**: Process the node (and its children in Inherit + mode) only when the game is not paused. +- **WhenPaused**: Process the node (and its children in Inherit + mode) *only* when the game is paused. +- **Always**: Process the node (and its children in Inherit + mode) no matter what. Paused or not, this node will process. +- **Disabled**: The node (and its children in Inherit + mode) will not process at all. By default, all nodes have this property in the "Inherit" state. If the parent is set to "Inherit", then the grandparent will be checked and so @@ -76,8 +78,7 @@ every node will be paused. Several things happen when a node stops processing. The ``_process``, ``_physics_process``, ``_input``, and ``_input_event`` functions will not be called. However signals still work and cause their connected function to -run, even if that function's script is attached to a node that has its pause -mode set to "Stop". +run, even if that function's script is attached to a node that is not currently being processed. Animation nodes will pause their current animation, audio nodes will pause their current audio stream, and particles will pause. These resume