Просмотр исходного кода

Fix various spacing and capitalization issues

Hugo Locurcio 5 лет назад
Родитель
Сommit
4f6fdbc710

+ 1 - 1
community/contributing/best_practices_for_engine_contributors.rst

@@ -23,7 +23,7 @@ Best Practices
 #1: The problem always comes first
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Many contributors are extremely creative and just enjoy the process of designing abstract data structures, creating nice user interfaces,or simply love programming. Whatever the case may be, they come up with cool ideas, which may not be actually solving any actual problems.
+Many contributors are extremely creative and just enjoy the process of designing abstract data structures, creating nice user interfaces, or simply love programming. Whatever the case may be, they come up with cool ideas, which may not be actually solving any actual problems.
 
 .. image:: img/best_practices1.png
 

+ 1 - 1
getting_started/scripting/gdscript/gdscript_format_string.rst

@@ -215,7 +215,7 @@ before ``*``:
 ::
 
     print("%0*d" % [2, 3])
-    #output: "03"
+    # Output: "03"
 
 
 Escape sequence

+ 14 - 14
getting_started/scripting/visual_script/custom_visualscript_nodes.rst

@@ -35,59 +35,59 @@ Example:
     tool
     extends VisualScriptCustomNode
 
-    # the name of the custom node as it appears in the search
+    # The name of the custom node as it appears in the search.
     func _get_caption():
         return "Get Input Direction 2D"
 
     func _get_category():
         return "Input"
 
-    # the text displayed after the input port / sequence arrow
+    # The text displayed after the input port / sequence arrow.
     func _get_text():
         return ""
 
     func _get_input_value_port_count():
         return 0
 
-    # the types of the inputs per index starting from 0
+    # The types of the inputs per index starting from 0.
     func _get_input_value_port_type(idx):
         return TYPE_OBJECT
 
     func _get_output_value_port_count():
         return 1
 
-    # the types of outputs per index starting from 0
+    # The types of outputs per index starting from 0.
     func _get_output_value_port_type(idx):
         return TYPE_VECTOR2
 
-    # the text displayed before each output node per index
+    # The text displayed before each output node per index.
     func _get_output_value_port_name(idx):
         return "Direction"
 
     func _has_input_sequence_port():
         return true
 
-    # the number of output sequence ports to use
-    # (has to be at least one if you have an input sequence port)
+    # The number of output sequence ports to use
+    # (has to be at least one if you have an input sequence port).
     func _get_output_sequence_port_count():
         return 1
 
     func _step(inputs, outputs, start_mode, working_mem):
-        # start_mode can be checked to see if it is the first time _step is called
-        # this is useful if you only want to do an operation once
+        # start_mode can be checked to see if it is the first time _step is called.
+        # This is useful if you only want to do an operation once.
 
-        # working_memory is persistent between _step calls
+        # working_memory is persistent between _step calls.
 
-        # the inputs array contains the value of the input ports
+        # The inputs array contains the value of the input ports.
 
         var x = int(Input.is_action_pressed("ui_right")) - int(Input.is_action_pressed("ui_left"))
         var y = int(Input.is_action_pressed("ui_down")) - int(Input.is_action_pressed("ui_up"))
 
-        # the outputs array is used to set the data of the output ports
+        # The outputs array is used to set the data of the output ports.
 
-        outputs[0] = Vector2(x,y)
+        outputs[0] = Vector2(x, y)
 
-        # return the error string if an error occurred, else the id of the next sequence port
+        # Return the error string if an error occurred, else the id of the next sequence port.
         return 0
 
 Using a custom node

+ 1 - 1
getting_started/scripting/visual_script/nodes_purposes.rst

@@ -495,7 +495,7 @@ Expression nodes can:
 .. image:: img/visual_script48.png
 
 
-- Use most of the existing built-in functions that are available to GDScript, such as sin(),cos(),print(), as well as constructors, such as Vector3(x,y,z),Rect2(..), etc.:
+- Use most of the existing built-in functions that are available to GDScript, such as ``sin()``, ``cos()``, ``print()``, as well as constructors, such as ``Vector3(x, y, z)``, ``Rect2(...)``, etc.:
 
 .. image:: img/visual_script49.png
 

+ 2 - 2
tutorials/2d/custom_drawing_in_2d.rst

@@ -80,8 +80,8 @@ redrawn if modified:
     func _set_texture(value):
         # If the texture variable is modified externally,
         # this callback is called.
-        texture = value #texture was changed
-        update() # update the node
+        texture = value  # Texture was changed.
+        update()  # Update the node's visual representation.
 
     func _draw():
         draw_texture(texture, Vector2())

+ 1 - 1
tutorials/3d/csg_tools.rst

@@ -60,7 +60,7 @@ CSGPolygon
 ~~~~~~~~~~
 
 The :ref:`CSGPolygon <class_CSGPolygon>` node extrude along a Polygon drawn in
-2D (in X,Y coordinates) in the following ways:
+2D (in X, Y coordinates) in the following ways:
 
 - **Depth:** Extruded back a given amount.
 - **Spin:** Extruded while spinning around its origin.

+ 3 - 3
tutorials/3d/fps_tutorial/part_six.rst

@@ -894,9 +894,9 @@ Now that we've finished our changes to ``SimpleAudioPlayer.gd``, we now need to
 
     # You will need to provide your own sound files.
     var audio_clips = {
-        "Pistol_shot":null, #preload("res://path_to_your_audio_here!")
-        "Rifle_shot":null, #preload("res://path_to_your_audio_here!")
-        "Gun_cock":null, #preload("res://path_to_your_audio_here!")
+        "Pistol_shot": null, #preload("res://path_to_your_audio_here!")
+        "Rifle_shot": null, #preload("res://path_to_your_audio_here!")
+        "Gun_cock": null, #preload("res://path_to_your_audio_here!")
     }
 
     const SIMPLE_AUDIO_PLAYER_SCENE = preload("res://Simple_Audio_Player.tscn")

+ 4 - 4
tutorials/3d/introduction_to_3d.rst

@@ -28,9 +28,9 @@ node for everything 3D.
 
 Spatial nodes have a local transform, which is relative to the parent
 node (as long as the parent node is also of **or inherits from** the type
-Spatial). This transform can be accessed as a 4x3
+Spatial). This transform can be accessed as a 4×3
 :ref:`Transform <class_Transform>`, or as 3 :ref:`Vector3 <class_Vector3>`
-members representing location, Euler rotation (x,y and z angles) and
+members representing location, Euler rotation (X, Y and Z angles) and
 scale.
 
 .. image:: img/tuto_3d2.png
@@ -150,10 +150,10 @@ Space and manipulation gizmos
 -----------------------------
 
 Moving objects in the 3D view is done through the manipulator gizmos.
-Each axis is represented by a color: Red, Green, Blue represent X,Y,Z
+Each axis is represented by a color: Red, Green, Blue represent X, Y, Z
 respectively. This convention applies to the grid and other gizmos too
 (and also to the shader language, ordering of components for
-Vector3,Color,etc.).
+Vector3, Color, etc.).
 
 .. image:: img/tuto_3d5.png
 

+ 1 - 1
tutorials/3d/using_transforms.rst

@@ -40,7 +40,7 @@ This could be done by first rotating in *X*, then *Y* and then in *Z*. Alternati
 but depending on the order, the final orientation of the object will *not necessarily be the same*. Indeed, this means that there are several ways to construct an orientation
 from 3 different angles, depending on *the order of the rotations*.
 
-Following is a visualization of rotation axes (in X,Y,Z order) in a gimbal (from Wikipedia). As you can see, the orientation of each axis depends on the rotation of the previous one:
+Following is a visualization of rotation axes (in X, Y, Z order) in a gimbal (from Wikipedia). As you can see, the orientation of each axis depends on the rotation of the previous one:
 
 .. image:: img/transforms_gimbal.gif
 

+ 1 - 1
tutorials/assetlib/uploading_to_assetlib.rst

@@ -159,7 +159,7 @@ be patient! You will be informed when your asset is reviewed. If it was rejected
 you will be told why that may have been, and you will be able to submit it again
 with the appropriate changes.
 You may have some luck accelerating the approval process by messaging the
-moderators/assetlib reviewers on IRC (the #godotengine-atelier channel on Freenode),
+moderators/assetlib reviewers on IRC (the ``#godotengine-atelier`` channel on Freenode),
 or the official Discord server.
 
 .. |image0| image:: ./img/assetlib_submit.png

+ 1 - 1
tutorials/content/making_trees.rst

@@ -72,7 +72,7 @@ Finally, all that's left is the fragment shader:
 .. code-block:: glsl
 
     void fragment() {
-        vec4 albedo_tex = texture(texture_albedo,UV);
+        vec4 albedo_tex = texture(texture_albedo, UV);
         ALBEDO = albedo_tex.rgb;
         ALPHA = albedo_tex.a;
         METALLIC = 0.0;

+ 1 - 1
tutorials/gui/size_and_anchors.rst

@@ -26,7 +26,7 @@ the parent control or (in case there is no parent control) the viewport.
 
 .. image:: img/margin.png
 
-When horizontal (left,right) and/or vertical (top,bottom) anchors are
+When horizontal (left, right) and/or vertical (top, bottom) anchors are
 changed to 1, the margin values become relative to the bottom-right
 corner of the parent control or viewport.
 

+ 1 - 1
tutorials/i18n/locales.rst

@@ -649,7 +649,7 @@ based on the Unix standard locale strings:
 +--------------+------------------------------------+
 | th_TH        | Thai (Thailand)                    |
 +--------------+------------------------------------+
-| th_TH_TH     | Thai (Thailand,TH)                 |
+| th_TH_TH     | Thai (Thailand, TH)                |
 +--------------+------------------------------------+
 | ti           | Tigrinya                           |
 +--------------+------------------------------------+

+ 1 - 1
tutorials/math/matrices_and_transforms.rst

@@ -52,7 +52,7 @@ as showing which vectors contribute to moving in a given direction.
 
 When we refer to a value such as `t.x.y`, that's the Y component of
 the X column vector. In other words, the bottom-left of the matrix.
-Similarly, `t.x.x` is top-left, `t.y.x` is top-right,and `t.y.y`
+Similarly, `t.x.x` is top-left, `t.y.x` is top-right, and `t.y.y`
 is bottom-right, where `t` is the Transform2D.
 
 Scaling the transformation matrix

+ 1 - 1
tutorials/networking/http_client_class.rst

@@ -77,7 +77,7 @@ It will connect and fetch a website.
             else:
                 # Or just plain Content-Length
                 var bl = http.get_response_body_length()
-                print("Response Length: ",bl)
+                print("Response Length: ", bl)
 
             # This method works for both anyway
 

+ 37 - 38
tutorials/platform/android_in_app_purchases.rst

@@ -3,59 +3,60 @@
 Android in-app purchases
 ========================
 
-Godot engine has integrated GooglePaymentsV3 module with which we can implement in-app purchases in our game.
+Godot Engine has integrated GooglePaymentsV3 module with which we can implement in-app purchases in our game.
 
-The Godot engine demo project repository has an android-iap example project. It includes a gdscript interface for android IAP.
+The `Godot demo projects repository <https://github.com/godotengine/godot-demo-projects>`__
+has an `android_iap <https://github.com/godotengine/godot-demo-projects/tree/master/misc/android_iap>`__
+example project. It includes a GDScript interface for Android IAPs.
 
-Check the repository here https://github.com/godotengine/godot-demo-projects
-
-Find the iap.gd script in
+Find the ``iap.gd`` script in:
 
 .. code-block:: none
 
     godot-demo-projects/misc/android_iap
 
-
-Add it to the Autoload list and name it as IAP so that we can reference it anywhere in the game.
+Copy it to your project, then open the Project Settings, add it to the AutoLoad
+list and name it as IAP so that we can reference it anywhere in the game.
 
 Getting the product details
 ---------------------------
 
-When starting our game, we will need to get the item details from Google such as the product price, description and localized price string etc.
+When starting our game, we will need to get the item details from Google such as the product price, description, localized price string, etc.
 
 ::
 
-    #First listen to the sku details update callback
-    IAP.connect("sku_details_complete",self,"sku_details_complete")
+    # First, listen to the SKU details update callback.
+    IAP.connect("sku_details_complete", self, "sku_details_complete")
 
-    #Then ask google the details for these items
-    IAP.sku_details_query(["pid1","pid2"]) #pid1 and pid2 are our product ids entered in Googleplay dashboard
+    # Then ask Google the details for these items.
+    # pid1 and pid2 are our product IDs entered in the Google Play dashboard.
+    IAP.sku_details_query(["pid1", "pid2"])
 
 
-    #This will be called when sku details are retrieved successfully
+    # This will be called when SKU details are retrieved successfully.
     func sku_details_complete():
-        print(IAP.sku_details) #This will print the details as JSON format, refer the format in iap.gd
-        print(IAP.sku_details["pid1"].price) #print formatted localized price
+        print(IAP.sku_details)  # This will print the details as JSON format. Refer to the format in `iap.gd`.
+        print(IAP.sku_details["pid1"].price)  # Print formatted localized price.
 
 We can use the IAP details to display the title, price and/or description on our shop scene.
 
 Check if user purchased an item
 -------------------------------
 
-When starting our game, we can check if the user has purchased any product. YOU SHOULD DO THIS ONLY AFTER 2/3 SECONDS AFTER YOUR GAME IS LOADED. If we do this as the first thing when the game is launched, IAP might not be initialized and our game will crash on start.
+When starting our game, we can check if the user has purchased any product. **You should do this only after 2/3 seconds after your game is loaded.** If we do this as the first thing when the game is launched, IAPs might not be initialized and our game will crash on start.
 
 ::
 
-    #Add a listener first
-    IAP.connect("has_purchased",self,"iap_has_purchased")
+    # Add a listener first.
+    IAP.connect("has_purchased", self, "iap_has_purchased")
     IAP.request_purchased() #Ask Google for all purchased items
 
-    #This will call for each and every user purchased products
+    # This will call for each and every user's purchased products.
     func iap_has_purchased(item_name):
         print(item_name) #print the name of purchased items
 
 
-Google IAP policy says the game should restore the user's purchases if the user replaces their phone or reinstalls the same app. We can use the above code to check what products the user has purchased and we can make our game respond accordingly.
+The Google IAP policy says the game should restore the user's purchases if the user replaces their phone or reinstalls the same app. We can use the above code to check what products the user has purchased and we can make our game respond accordingly.
 
 Simple Purchase
 ---------------
@@ -64,38 +65,36 @@ We can put this purchase logic on a product's buy button.
 
 ::
 
-    #First listen for purchase_success callback
-    IAP.connect("purchase_success",self,"purchase_success_callback")
+    # First, listen for purchase_success callback.
+    IAP.connect("purchase_success", self, "purchase_success_callback")
 
-    #Then call purchase like this
-    IAP.purchase("pid1") #replace pid1 with your product id
-    IAP.purchase("pid2") #replace pid2 with your another product id
+    # Then call `purchase()` like this:
+    IAP.purchase("pid1")  # Replace pid1 with one of your product IDs.
+    IAP.purchase("pid2")  # Replace pid2 with another of your product IDs.
 
-    #This function will be called when the purchase is a success
+    # This function will be called when the purchase is a success.
     func purchase_success_callback(item):
         print(item + " has purchased")
 
 We can also implement other signals for the purchase flow and improve the user experience as you needed.
 
-``purchase_fail`` - When the purchase is failed due to any reason
-
-``purchase_cancel`` - When the user cancels the purchase
-
-``purchase_owned`` - When the user already bought the product earlier
-
+- ``purchase_fail``: When the purchase is failed due to any reason.
+- ``purchase_cancel``: When the user cancels the purchase.
+- ``purchase_owned``: When the user already bought the product earlier.
 
 Consumables and Non-Consumables
 -------------------------------
 
-There are two types of products - consumables and non-consumables.
-**Consumables** are purchased and used, for eg: healing potions which can be purchased again and again.
-**Non-consumables** are one time purchases, for eg: Level packs.
+There are two types of products - consumables and non-consumables:
+
+- **Consumables** are purchased and used, for example, healing potions which can be purchased again and again.
+- **Non-consumables** are one time purchases, for example, level packs.
 
 Google doesn't have this separation in their dashboard. If our product is a consumable, and if a user has purchased it, it will not be available for purchase until it is consumed. So we should call the consume method for our consumables and don't call consume for your non-consumables.
 
 ::
 
-    IAP.connect("consume_success",self,"on_consume_success")
+    IAP.connect("consume_success", self, "on_consume_success")
     IAP.consume("pid")
 
     func on_consume_success(item):
@@ -118,9 +117,9 @@ We should set the auto consume value only once when the game starts.
 Testing
 -------
 
-If we add a gmail id as a tester in Google dashboard, that tester can purchase items and they will not be charged. Another way to test IAP is using redeem codes generated by us for our game because the purchase flow is the same.
+If we add a Gmail ID as a tester in the Google Play dashboard, that tester can purchase items and they will not be charged. Another way to test IAP is using redeem codes generated by us for our game because the purchase flow is the same.
 
-Third way of testing is in development side. If we put the product ids as shown below, we will get a static fixed response according to the product id. This is a quick way of testing things before going to the dashboard.
+Third way of testing is in development side. If we put the product ids as shown below, we will get a static fixed response according to the product ID. This is a quick way of testing things before going to the dashboard.
 
 - android.test.purchased
 - android.test.canceled

+ 19 - 19
tutorials/shading/shading_reference/shading_language.rst

@@ -581,25 +581,25 @@ It's important to understand that textures that are supplied as color require hi
 
 Full list of hints below:
 
-+----------------+-----------------------------+-------------------------------------+
-| Type           | Hint                        | Description                         |
-+================+=============================+=====================================+
-| **vec4**       | hint_color                  | Used as color                       |
-+----------------+-----------------------------+-------------------------------------+
-| **int, float** | hint_range(min,max [,step]) | Used as range (with min/max/step)   |
-+----------------+-----------------------------+-------------------------------------+
-| **sampler2D**  | hint_albedo                 | Used as albedo color, default white |
-+----------------+-----------------------------+-------------------------------------+
-| **sampler2D**  | hint_black_albedo           | Used as albedo color, default black |
-+----------------+-----------------------------+-------------------------------------+
-| **sampler2D**  | hint_normal                 | Used as normalmap                   |
-+----------------+-----------------------------+-------------------------------------+
-| **sampler2D**  | hint_white                  | As value, default to white.         |
-+----------------+-----------------------------+-------------------------------------+
-| **sampler2D**  | hint_black                  | As value, default to black          |
-+----------------+-----------------------------+-------------------------------------+
-| **sampler2D**  | hint_aniso                  | As flowmap, default to right.       |
-+----------------+-----------------------------+-------------------------------------+
++----------------+------------------------------+-------------------------------------+
+| Type           | Hint                         | Description                         |
++================+==============================+=====================================+
+| **vec4**       | hint_color                   | Used as color                       |
++----------------+------------------------------+-------------------------------------+
+| **int, float** | hint_range(min, max[, step]) | Used as range (with min/max/step)   |
++----------------+------------------------------+-------------------------------------+
+| **sampler2D**  | hint_albedo                  | Used as albedo color, default white |
++----------------+------------------------------+-------------------------------------+
+| **sampler2D**  | hint_black_albedo            | Used as albedo color, default black |
++----------------+------------------------------+-------------------------------------+
+| **sampler2D**  | hint_normal                  | Used as normalmap                   |
++----------------+------------------------------+-------------------------------------+
+| **sampler2D**  | hint_white                   | As value, default to white.         |
++----------------+------------------------------+-------------------------------------+
+| **sampler2D**  | hint_black                   | As value, default to black          |
++----------------+------------------------------+-------------------------------------+
+| **sampler2D**  | hint_aniso                   | As flowmap, default to right.       |
++----------------+------------------------------+-------------------------------------+
 
 GDScript uses different variable types than GLSL does, so when passing variables from GDScript
 to shaders, Godot converts the type automatically. Below is a table of the corresponding types: