summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorNathan Franke <natfra@pm.me>2020-07-09 14:23:59 -0500
committerNathan Franke <natfra@pm.me>2020-07-10 02:56:37 -0500
commit6952458538ad669922614eb15a9ece45c0a235e3 (patch)
treef984eb2e2d1862697c362eaa1c75736f7f45e3e8 /doc/classes
parent006bb33b79fe110406a539a919d59e558fea5e1c (diff)
Follow-Up Fix Directory Open
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Directory.xml4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml
index ed4257a809..a86dbfedde 100644
--- a/doc/classes/Directory.xml
+++ b/doc/classes/Directory.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Directory type. It is used to manage directories and their content (not restricted to the project folder).
- When creating a new [Directory], its default opened directory will be [code]res://[/code]. This may change in the future, so it is advised to always use [method open] to initialize your [Directory] where you want to operate, with explicit error checking.
+ When creating a new [Directory], it must be explicitly opened using [method open] before most methods can be used. However, [method file_exists] and [method dir_exists] can be used without opening a directory. If so, they use a path relative to [code]res://[/code].
Here is an example on how to iterate through the files of a directory:
[codeblock]
func dir_contents(path):
@@ -63,6 +63,7 @@
</argument>
<description>
Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path.
+ If the [Directory] is not open, the path is relative to [code]res://[/code].
</description>
</method>
<method name="file_exists">
@@ -72,6 +73,7 @@
</argument>
<description>
Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path.
+ If the [Directory] is not open, the path is relative to [code]res://[/code].
</description>
</method>
<method name="get_current_dir">