summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-24 17:05:49 +0200
committerGitHub <noreply@github.com>2020-09-24 17:05:49 +0200
commitf21b32aa045592b1975682e157b6c90345f6daf1 (patch)
tree987c95b713701d0e258e74a7a567833585455778 /doc
parent93303737ac4675d401199183a3982e7511af461c (diff)
parent75c5a8b3542a288d055b9d7ed73fba0596c0031f (diff)
Merge pull request #41683 from skyace65/File
Move note about using ResourceLoader in the File documentation
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/File.xml3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/classes/File.xml b/doc/classes/File.xml
index 1982406993..f1b9106d35 100644
--- a/doc/classes/File.xml
+++ b/doc/classes/File.xml
@@ -21,6 +21,7 @@
return content
[/codeblock]
In the example above, the file will be saved in the user data folder as specified in the [url=https://docs.godotengine.org/en/latest/tutorials/io/data_paths.html]Data paths[/url] documentation.
+ [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of the [File] API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package.
</description>
<tutorials>
<link title="File system">https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link>
@@ -48,7 +49,7 @@
</argument>
<description>
Returns [code]true[/code] if the file exists in the given path.
- [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and that their source asset will not be included in the exported game, as only the imported version is used (in the [code]res://.import[/code] folder). To check for the existence of such resources while taking into account the remapping to their imported location, use [method ResourceLoader.exists]. Typically, using [code]File.file_exists[/code] on an imported resource would work while you are developing in the editor (the source asset is present in [code]res://[/code], but fail when exported).
+ [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. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account.
</description>
</method>
<method name="get_16" qualifiers="const">