[DOCS] Node & PackedScene (#17833)

* [DOCS] Node: SceneSaver -> PackedScene

* [DOCS] PackedScene: Code example, resolve TODO
This commit is contained in:
Max Hilbrunner
2018-03-28 23:07:03 +02:00
committed by GitHub
parent b59ae81538
commit 13d5ee01f9
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -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>