summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/Area.xml2
-rw-r--r--doc/classes/Area2D.xml2
-rw-r--r--doc/classes/Array.xml8
-rw-r--r--doc/classes/BitmapFont.xml3
-rw-r--r--doc/classes/HTTPRequest.xml21
-rw-r--r--doc/classes/ImmediateGeometry.xml2
-rw-r--r--doc/classes/KinematicCollision.xml2
-rw-r--r--doc/classes/KinematicCollision2D.xml2
-rw-r--r--doc/classes/Node2D.xml4
-rw-r--r--doc/classes/OS.xml2
-rw-r--r--doc/classes/Object.xml6
11 files changed, 41 insertions, 13 deletions
diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml
index 6bd1382488..4b0858935d 100644
--- a/doc/classes/Area.xml
+++ b/doc/classes/Area.xml
@@ -166,7 +166,7 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- Emitted when another area enters, reporting which areas overlapped.
+ Emitted when another area enters, reporting which areas overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code].
</description>
</signal>
<signal name="area_shape_exited">
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml
index 9a5870c73d..be3acee9ef 100644
--- a/doc/classes/Area2D.xml
+++ b/doc/classes/Area2D.xml
@@ -155,7 +155,7 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- Emitted when another area enters, reporting which shapes overlapped.
+ Emitted when another area enters, reporting which shapes overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code].
</description>
</signal>
<signal name="area_shape_exited">
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index e09c1f4b08..2d330fc935 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -93,7 +93,7 @@
<return type="Variant">
</return>
<description>
- Returns the last element of the array if the array is not empty.
+ Returns the last element of the array, or [code]null[/code] if the array is empty.
</description>
</method>
<method name="bsearch">
@@ -186,7 +186,7 @@
<return type="Variant">
</return>
<description>
- Returns the first element of the array if the array is not empty.
+ Returns the first element of the array, or [code]null[/code] if the array is empty.
</description>
</method>
<method name="has">
@@ -243,14 +243,14 @@
<return type="Variant">
</return>
<description>
- Removes the last element of the array.
+ Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty.
</description>
</method>
<method name="pop_front">
<return type="Variant">
</return>
<description>
- Removes the first element of the array.
+ Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty.
</description>
</method>
<method name="push_back">
diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml
index 16a28978d5..5b7c3def63 100644
--- a/doc/classes/BitmapFont.xml
+++ b/doc/classes/BitmapFont.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BitmapFont" inherits="Font" category="Core" version="3.2">
<brief_description>
- Renders text using [code]*.fnt[/code] fonts.
+ Renders text using fonts under the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format.
+ Handles files with the [code].fnt[/code] extension
</brief_description>
<description>
Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont].
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 2fed423a32..748ed504c3 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -6,6 +6,27 @@
<description>
A node with the ability to send HTTP requests. Uses [HTTPClient] internally.
Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP.
+ [b]Example of contacting a REST API and printing one of its returned fields:[/b]
+ [codeblock]
+ func _ready():
+ # Create an HTTP request node and connect its completion signal.
+ var http_request = HTTPRequest.new()
+ add_child(http_request)
+ http_request.connect("request_completed", self, "_http_request_completed")
+
+ # Perform the HTTP request. The URL below returns some JSON as of writing.
+ var error = http_request.request("https://httpbin.org/get")
+ if error != OK:
+ push_error("An error occurred in the HTTP request.")
+
+
+ # Called when the HTTP request is completed.
+ func _http_request_completed(result, response_code, headers, body):
+ var response = parse_json(body.get_string_from_utf8())
+
+ # Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org).
+ print(response.headers["User-Agent"])
+ [/codeblock]
[b]Example of loading and displaying an image using HTTPRequest:[/b]
[codeblock]
func _ready():
diff --git a/doc/classes/ImmediateGeometry.xml b/doc/classes/ImmediateGeometry.xml
index e0807760f7..416128c9b1 100644
--- a/doc/classes/ImmediateGeometry.xml
+++ b/doc/classes/ImmediateGeometry.xml
@@ -30,7 +30,7 @@
<argument index="0" name="position" type="Vector3">
</argument>
<description>
- Adds a vertex with the currently set color/uv/etc.
+ Adds a vertex in local coordinate space with the currently set color/uv/etc.
</description>
</method>
<method name="begin">
diff --git a/doc/classes/KinematicCollision.xml b/doc/classes/KinematicCollision.xml
index 44447c8fc8..46e4176e9f 100644
--- a/doc/classes/KinematicCollision.xml
+++ b/doc/classes/KinematicCollision.xml
@@ -16,7 +16,7 @@
The colliding body.
</member>
<member name="collider_id" type="int" setter="" getter="get_collider_id" default="0">
- The colliding body's unique [RID].
+ The colliding body's unique instance ID. See [method Object.get_instance_id].
</member>
<member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata">
The colliding body's metadata. See [Object].
diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml
index 51c2277fb2..4c9337f82d 100644
--- a/doc/classes/KinematicCollision2D.xml
+++ b/doc/classes/KinematicCollision2D.xml
@@ -16,7 +16,7 @@
The colliding body.
</member>
<member name="collider_id" type="int" setter="" getter="get_collider_id" default="0">
- The colliding body's unique [RID].
+ The colliding body's unique instance ID. See [method Object.get_instance_id].
</member>
<member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata">
The colliding body's metadata. See [Object].
diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml
index 29c4680685..67e9597781 100644
--- a/doc/classes/Node2D.xml
+++ b/doc/classes/Node2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Node2D" inherits="CanvasItem" category="Core" version="3.2">
<brief_description>
- A 2D game object, parent of all 2D-related nodes. Has a position, rotation, scale and Z index.
+ A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index.
</brief_description>
<description>
- A 2D game object, with a position, rotation and scale. All 2D physics nodes and sprites inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control on the node's render order.
+ A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 54b4f3df64..265e87eba3 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -905,7 +905,7 @@
The current screen index (starting from 0).
</member>
<member name="exit_code" type="int" setter="set_exit_code" getter="get_exit_code" default="0">
- The exit code passed to the OS when the main loop exits.
+ The exit code passed to the OS when the main loop exits. By convention, an exit code of [code]0[/code] indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive).
</member>
<member name="keep_screen_on" type="bool" setter="set_keep_screen_on" getter="is_keep_screen_on" default="true">
If [code]true[/code], the engine tries to keep the screen on while the game is running. Useful on mobile.
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index 5a09fe39c0..1e5b8669fd 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -9,6 +9,12 @@
Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [method free] method from your script or delete the instance from C++.
Some classes that extend Object add memory management. This is the case of [Reference], which counts references and deletes itself automatically when no longer referenced. [Node], another fundamental type, deletes all its children when freed from memory.
Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them.
+ Property membership can be tested directly in GDScript using [code]in[/code]:
+ [codeblock]
+ var n = Node2D.new()
+ print("position" in n) # Prints "True".
+ print("other_property" in n) # Prints "False".
+ [/codeblock]
Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification].
</description>
<tutorials>