Browse Source

Merge branch 'godotengine:master' into master

PaulUlanovskij 1 year ago
parent
commit
759d94c713

+ 2 - 2
getting_started/first_2d_game/03.coding_the_player.rst

@@ -275,7 +275,7 @@ movement. Let's place this code at the end of the ``_process()`` function:
         if velocity.x != 0:
             $AnimatedSprite2D.animation = "walk"
             $AnimatedSprite2D.flip_v = false
-            # See the note below about boolean assignment.
+            # See the note below about the following boolean assignment.
             $AnimatedSprite2D.flip_h = velocity.x < 0
         elif velocity.y != 0:
             $AnimatedSprite2D.animation = "up"
@@ -287,7 +287,7 @@ movement. Let's place this code at the end of the ``_process()`` function:
         {
             animatedSprite2D.Animation = "walk";
             animatedSprite2D.FlipV = false;
-            // See the note below about boolean assignment.
+            // See the note below about the following boolean assignment.
             animatedSprite2D.FlipH = velocity.X < 0;
         }
         else if (velocity.Y != 0)

+ 18 - 15
tutorials/inputs/handling_quit_requests.rst

@@ -8,8 +8,8 @@ Quitting
 
 Most platforms have the option to request the application to quit. On
 desktops, this is usually done with the "x" icon on the window title bar.
-On Android, the back button is used to quit when on the main screen (and
-to go back otherwise).
+On mobile devices, the app can quit at any time while it is suspended
+to the background.
 
 Handling the notification
 -------------------------
@@ -18,16 +18,6 @@ On desktop and web platforms, :ref:`Node <class_Node>` receives a special
 ``NOTIFICATION_WM_CLOSE_REQUEST`` notification when quitting is requested from
 the window manager.
 
-On Android, ``NOTIFICATION_WM_GO_BACK_REQUEST`` is sent instead.
-Pressing the Back button will exit the application if
-**Application > Config > Quit On Go Back** is checked in the Project Settings
-(which is the default).
-
-.. note::
-
-    ``NOTIFICATION_WM_GO_BACK_REQUEST`` isn't supported on iOS, as
-    iOS devices don't have a physical Back button.
-
 Handling the notification is done as follows (on any node):
 
 .. tabs::
@@ -45,9 +35,6 @@ Handling the notification is done as follows (on any node):
             GetTree().Quit(); // default behavior
     }
 
-When developing mobile apps, quitting is not desired unless the user is
-on the main screen, so the behavior can be changed.
-
 It is important to note that by default, Godot apps have the built-in
 behavior to quit when quit is requested from the window manager. This
 can be changed, so that the user can take care of the complete quitting
@@ -62,6 +49,22 @@ procedure:
 
     GetTree().AutoAcceptQuit = false;
 
+On mobile devices
+-----------------
+
+There is no direct equivalent to ``NOTIFICATION_WM_CLOSE_REQUEST`` on mobile 
+platforms. Due to the nature of mobile operating systems, the only place 
+that you can run code prior to quitting is when the app is being suspended to 
+the background. On both Android and iOS, the app can be killed while suspended 
+at any time by either the user or the OS. A way to plan ahead for this 
+possibility is to utilize ``NOTIFICATION_APPLICATION_PAUSED`` in order to 
+perform any needed actions as the app is being suspended.
+
+On Android, pressing the Back button will exit the application if 
+**Application > Config > Quit** On Go Back is checked in the Project Settings 
+(which is the default). This will fire ``NOTIFICATION_WM_GO_BACK_REQUEST``.
+
+
 Sending your own quit notification
 ----------------------------------