mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Add note in 'load()' docs that the path must be absolute
This commit is contained in:
parent
cca13462f1
commit
6cc3bb2d9b
@ -616,9 +616,10 @@
|
||||
Loads a resource from the filesystem located at [code]path[/code].
|
||||
[b]Note:[/b] Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing [b]Copy Path[/b].
|
||||
[codeblock]
|
||||
# Load a scene called main located in the root of the project directory
|
||||
# Load a scene called main located in the root of the project directory.
|
||||
var main = load("res://main.tscn")
|
||||
[/codeblock]
|
||||
[b]Important:[/b] The path must be absolute, a local path will just return [code]null[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="log">
|
||||
@ -786,7 +787,7 @@
|
||||
Returns a resource from the filesystem that is loaded during script parsing.
|
||||
[b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path".
|
||||
[codeblock]
|
||||
# Load a scene called main located in the root of the project directory
|
||||
# Load a scene called main located in the root of the project directory.
|
||||
var main = preload("res://main.tscn")
|
||||
[/codeblock]
|
||||
</description>
|
||||
|
Loading…
Reference in New Issue
Block a user