Browse Source

Expand NodePath hints, added Resource hints to GDScript exports (#3473)

mechPenSketch 5 years ago
parent
commit
b844c946d9
1 changed files with 14 additions and 4 deletions
  1. 14 4
      getting_started/scripting/gdscript/gdscript_exports.rst

+ 14 - 4
getting_started/scripting/gdscript/gdscript_exports.rst

@@ -111,10 +111,20 @@ Examples
     export(Color, RGB) var col
     # Color given as red-green-blue-alpha value.
     export(Color, RGBA) var col
-
-    # Another node in the scene can be exported, too.
-
-    export(NodePath) var node
+    
+    # Nodes
+    
+    # Another node in the scene can be exported as a NodePath.
+    export(NodePath) var node_path
+    # Do take note that the node itself isn't being exported -
+    # there is one more step to call the true node:
+    var node = get_node(node_path)
+    
+    # Resources
+    
+    export(Resource) var resource
+    # In the Inspector, you can then drag and drop a resource file
+    # from the FileSystem dock into the variable slot.
 
 It must be noted that even if the script is not being run while in the
 editor, the exported properties are still editable. This can be used