Selaa lähdekoodia

Added export enums in gdscript_basics.rst

x2f 7 vuotta sitten
vanhempi
commit
576092fa3b
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      getting_started/scripting/gdscript/gdscript_basics.rst

+ 6 - 0
getting_started/scripting/gdscript/gdscript_basics.rst

@@ -989,6 +989,12 @@ special export syntax is provided.
     # Editor will enumerate with string names
     export(String, "Rebecca", "Mary", "Leah") var character_name
 
+    # Named enum values
+    
+    # Editor will enumerate as THING_1, THING_2, ANOTHER_THING
+    enum NamedEnum {THING_1, THING_2, ANOTHER_THING = -1}
+    export (NamedEnum) var x
+
     # Strings as paths
 
     # String is a path to a file