Quellcode durchsuchen

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

mechPenSketch vor 5 Jahren
Ursprung
Commit
b844c946d9
1 geänderte Dateien mit 14 neuen und 4 gelöschten Zeilen
  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
     export(Color, RGB) var col
     # Color given as red-green-blue-alpha value.
     # Color given as red-green-blue-alpha value.
     export(Color, RGBA) var col
     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
 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
 editor, the exported properties are still editable. This can be used