Browse Source

Merge pull request #1389 from x2f/patch-1

Added export enums in gdscript_basics.rst
Max Hilbrunner 7 years ago
parent
commit
9f526a3ea8
1 changed files with 6 additions and 0 deletions
  1. 6 0
      getting_started/scripting/gdscript/gdscript_basics.rst

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

@@ -1037,6 +1037,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