summaryrefslogtreecommitdiff
path: root/doc/classes/DirAccess.xml
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-09-22 06:12:13 +0200
committerGitHub <noreply@github.com>2022-09-22 06:12:13 +0200
commite5c544750c04951922dadff1c765d035414d0e28 (patch)
treeb897ee58cc2e987cf3c47e24f3bbbe01a22c4856 /doc/classes/DirAccess.xml
parent6e773f71243e2a6505266be714f7d82b0ca9d289 (diff)
parent185be4a788d7671d7c0fbac8c1074cd231d59230 (diff)
Merge pull request #66234 from KoBeWi/dir_access_denied
Fix wrong DirAccess example
Diffstat (limited to 'doc/classes/DirAccess.xml')
-rw-r--r--doc/classes/DirAccess.xml5
1 files changed, 2 insertions, 3 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: