diff options
| author | Max Hilbrunner | 2018-03-28 23:07:03 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-04-29 14:25:17 +0200 |
| commit | ec017f4c01d7e948a2762c8182cd3032e6237c75 (patch) | |
| tree | 3376ca9ac8dedbc68fce1528e7547f862305d0d4 /doc | |
| parent | f12db4013e211199eb9203540c2018e5a7c3834e (diff) | |
| download | godot-ec017f4c01d7e948a2762c8182cd3032e6237c75.tar.gz godot-ec017f4c01d7e948a2762c8182cd3032e6237c75.tar.zst godot-ec017f4c01d7e948a2762c8182cd3032e6237c75.zip | |
[DOCS] Node & PackedScene (#17833)
* [DOCS] Node: SceneSaver -> PackedScene
* [DOCS] PackedScene: Code example, resolve TODO
(cherry picked from commit 13d5ee01f9d62e8a4b867b46e902b5d9d25f9bd1)
Diffstat (limited to '')
| -rw-r--r-- | doc/classes/Node.xml | 2 | ||||
| -rw-r--r-- | doc/classes/PackedScene.xml | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index d1ea14949..2ab8c7dfe 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -769,7 +769,7 @@ The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed </member> <member name="owner" type="Node" setter="set_owner" getter="get_owner"> - The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using SceneSaver) all the nodes it owns will be saved with it. This allows for the creation of complex [SceneTree]s, with instancing and subinstancing. + The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using [PackedScene]) all the nodes it owns will be saved with it. This allows for the creation of complex [SceneTree]s, with instancing and subinstancing. </member> <member name="pause_mode" type="int" setter="set_pause_mode" getter="get_pause_mode" enum="Node.PauseMode"> Pause mode. How the node will behave if the [SceneTree] is paused. diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index f277beff2..1a3f6f31a 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -5,7 +5,14 @@ </brief_description> <description> A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself. - TODO: explain ownership, and that node does not need to own itself + Can be used to save a node to a file. When saving, the node as well as all the node it owns get saved (see [code]owner[/code] property on [Node]). Note that the node doesn't need to own itself. + Example of saving a node: + [codeblock] + var scene = PackedScene.new() + var result = scene.pack(child) + if result == OK: + ResourceSaver.save("res://path/name.scn", scene) // or user://... + [/codeblock] </description> <tutorials> </tutorials> |
