summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJason Yundt <jason@jasonyundt.email>2022-07-28 17:25:57 -0400
committerJason Yundt <jason@jasonyundt.email>2022-09-07 17:06:33 -0400
commit69963ffaa346017439bbd0c66a83831e5b1a878b (patch)
treec129971c3c64caf1227e64ee29c73b8e4d3d80ca /doc
parentd1be14a9cbb10721d998a936169a55fa464dc687 (diff)
Rename change_scene() and change_scene_to()
Before this change, the SceneTree had methods named “change_scene” and “change_scene_to”. One of them accepted a String as a parameter and the other accepted a PackedScene, but you couldn’t tell which one was which just by looking at their names. This change renames those two methods to “change_scene_to_file” and “change_scene_to_packed”. These new names came from this suggestion [1]. These new names make the difference between the two methods more clear and hint at the fact that there’s more than one change_scene method. [1]: <https://github.com/godotengine/godot/issues/27640#issuecomment-1081870955> Fixes #27640.
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/SceneTree.xml8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index 221e627e35..070b98f21d 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -36,22 +36,22 @@
[b]Note:[/b] Group call flags are used to control the method calling behavior. By default, methods will be called immediately in a way similar to [method call_group]. However, if the [constant GROUP_CALL_DEFERRED] flag is present in the [param flags] argument, methods will be called with a one-frame delay in a way similar to [method Object.set_deferred].
</description>
</method>
- <method name="change_scene">
+ <method name="change_scene_to_file">
<return type="int" enum="Error" />
<param index="0" name="path" type="String" />
<description>
Changes the running scene to the one at the given [param path], after loading it into a [PackedScene] and creating a new instance.
Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [param path] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if that scene cannot be instantiated.
- [b]Note:[/b] The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [method change_scene] call.
+ [b]Note:[/b] The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [method change_scene_to_file] call.
</description>
</method>
- <method name="change_scene_to">
+ <method name="change_scene_to_packed">
<return type="int" enum="Error" />
<param index="0" name="packed_scene" type="PackedScene" />
<description>
Changes the running scene to a new instance of the given [PackedScene].
Returns [constant OK] on success or [constant ERR_CANT_CREATE] if the scene cannot be instantiated.
- [b]Note:[/b] The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [method change_scene_to] call.
+ [b]Note:[/b] The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [method change_scene_to_packed] call.
</description>
</method>
<method name="create_timer">