summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/DirAccess.xml5
-rw-r--r--doc/classes/EditorImportPlugin.xml6
-rw-r--r--doc/classes/EditorScenePostImport.xml2
-rw-r--r--doc/classes/EditorScript.xml2
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml2
-rw-r--r--doc/classes/NavigationRegion2D.xml1
-rw-r--r--doc/classes/NavigationRegion3D.xml1
-rw-r--r--doc/classes/PackedScene.xml4
-rw-r--r--doc/classes/RefCounted.xml6
9 files changed, 18 insertions, 11 deletions
diff --git a/doc/classes/DirAccess.xml b/doc/classes/DirAccess.xml
index cb7bf56f11..af498a6519 100644
--- a/doc/classes/DirAccess.xml
+++ b/doc/classes/DirAccess.xml
@@ -9,11 +9,10 @@
Most of the methods have a static alternative that can be used without creating a [DirAccess]. Static methods only support absolute paths (including [code]res://[/code] and [code]user://[/code]).
[codeblock]
# Standard
- var dir = Directory.new()
- dir.open("user://levels")
+ var dir = DirAccess.open("user://levels")
dir.make_dir("world1")
# Static
- Directory.make_dir_absolute("user://levels/world1")
+ DirAccess.make_dir_absolute("user://levels/world1")
[/codeblock]
[b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. Use [ResourceLoader] to access imported resources.
Here is an example on how to iterate through the files of a directory:
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index 348347c4ef..c395815117 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -9,7 +9,7 @@
Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec":
[codeblocks]
[gdscript]
- tool
+ @tool
extends EditorImportPlugin
func _get_importer_name():
@@ -44,7 +44,7 @@
# Fill the Mesh with data read in "file", left as an exercise to the reader.
var filename = save_path + "." + _get_save_extension()
- return ResourceSaver.save(filename, mesh)
+ return ResourceSaver.save(mesh, filename)
[/gdscript]
[csharp]
using Godot;
@@ -103,7 +103,7 @@
var mesh = new ArrayMesh();
// Fill the Mesh with data read in "file", left as an exercise to the reader.
String filename = savePath + "." + GetSaveExtension();
- return (int)ResourceSaver.Save(filename, mesh);
+ return (int)ResourceSaver.Save(mesh, filename);
}
}
[/csharp]
diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml
index 395b094bf2..2bf2accf17 100644
--- a/doc/classes/EditorScenePostImport.xml
+++ b/doc/classes/EditorScenePostImport.xml
@@ -8,7 +8,7 @@
The [method _post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example:
[codeblocks]
[gdscript]
- tool # Needed so it runs in editor.
+ @tool # Needed so it runs in editor.
extends EditorScenePostImport
# This sample changes all node names.
# Called right after the scene is imported and gets the root node.
diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml
index 2ff8a7ba2a..dfc04c9cde 100644
--- a/doc/classes/EditorScript.xml
+++ b/doc/classes/EditorScript.xml
@@ -9,7 +9,7 @@
[b]Example script:[/b]
[codeblocks]
[gdscript]
- tool
+ @tool
extends EditorScript
func _run():
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
index 08986781cd..df10c645ef 100644
--- a/doc/classes/EditorTranslationParserPlugin.xml
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -11,7 +11,7 @@
Below shows an example of a custom parser that extracts strings from a CSV file to write into a POT.
[codeblocks]
[gdscript]
- tool
+ @tool
extends EditorTranslationParserPlugin
func _parse_file(path, msgids, msgids_context_plural):
diff --git a/doc/classes/NavigationRegion2D.xml b/doc/classes/NavigationRegion2D.xml
index 89f7dcb4af..0f28081201 100644
--- a/doc/classes/NavigationRegion2D.xml
+++ b/doc/classes/NavigationRegion2D.xml
@@ -10,6 +10,7 @@
The pathfinding cost of entering this region from another region can be controlled with the [member enter_cost] value.
[b]Note:[/b] This value is not added to the path cost when the start position is already inside this region.
The pathfinding cost of traveling distances inside this region can be controlled with the [member travel_cost] multiplier.
+ [b]Note:[/b] This node caches changes to its properties, so if you make changes to the underlying region [RID] in [NavigationServer2D], they will not be reflected in this node's properties.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/NavigationRegion3D.xml b/doc/classes/NavigationRegion3D.xml
index 87e82e7b2e..85f163b3c2 100644
--- a/doc/classes/NavigationRegion3D.xml
+++ b/doc/classes/NavigationRegion3D.xml
@@ -10,6 +10,7 @@
The cost of entering this region from another region can be controlled with the [member enter_cost] value.
[b]Note:[/b] This value is not added to the path cost when the start position is already inside this region.
The cost of traveling distances inside this region can be controlled with the [member travel_cost] multiplier.
+ [b]Note:[/b] This node caches changes to its properties, so if you make changes to the underlying region [RID] in [NavigationServer3D], they will not be reflected in this node's properties.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml
index 97595a6984..7ca1d5d60d 100644
--- a/doc/classes/PackedScene.xml
+++ b/doc/classes/PackedScene.xml
@@ -41,7 +41,7 @@
# Only `node` and `body` are now packed.
var result = scene.pack(node)
if result == OK:
- var error = ResourceSaver.save("res://path/name.tscn", scene) # Or "user://..."
+ var error = ResourceSaver.save(scene, "res://path/name.tscn") # Or "user://..."
if error != OK:
push_error("An error occurred while saving the scene to disk.")
[/gdscript]
@@ -63,7 +63,7 @@
Error result = scene.Pack(node);
if (result == Error.Ok)
{
- Error error = ResourceSaver.Save("res://path/name.tscn", scene); // Or "user://..."
+ Error error = ResourceSaver.Save(scene, "res://path/name.tscn"); // Or "user://..."
if (error != Error.Ok)
{
GD.PushError("An error occurred while saving the scene to disk.");
diff --git a/doc/classes/RefCounted.xml b/doc/classes/RefCounted.xml
index 3daf3534b0..223e572254 100644
--- a/doc/classes/RefCounted.xml
+++ b/doc/classes/RefCounted.xml
@@ -13,6 +13,12 @@
<link title="When and how to avoid using nodes for everything">$DOCS_URL/tutorials/best_practices/node_alternatives.html</link>
</tutorials>
<methods>
+ <method name="get_reference_count" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the current reference count.
+ </description>
+ </method>
<method name="init_ref">
<return type="bool" />
<description>