瀏覽代碼

Document new feature allowing `@export`ed Arrays to set property hints for their elements (#9061)

* Document export variations for arrays

* Update tutorials/scripting/gdscript/gdscript_exports.rst

Co-authored-by: Raul Santos <[email protected]>

---------

Co-authored-by: Max Hilbrunner <[email protected]>
Co-authored-by: Raul Santos <[email protected]>
Abel Toy 1 年之前
父節點
當前提交
bd7bc61e9e
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      tutorials/scripting/gdscript/gdscript_exports.rst

+ 9 - 0
tutorials/scripting/gdscript/gdscript_exports.rst

@@ -368,6 +368,15 @@ Packed type arrays also work, but only initialized empty:
     @export var vector3s = PackedVector3Array()
     @export var strings = PackedStringArray()
 
+Other export variants can also be used when exporting arrays:
+
+::
+
+    @export_range(-360, 360, 0.001, "radians") var laser_angles: Array[float] = []
+    @export_file("*.json") var skill_trees: Array[String] = []
+    @export_color_no_alpha var hair_colors = PackedColorArray()
+    @export_enum("Espresso", "Mocha", "Latte", "Capuccino") var barista_suggestions: Array[String] = []
+
 ``@export_storage``
 -------------------