Browse Source

[GDScript] Clarify initialization of enum values

# Conflicts:
#	tutorials/scripting/gdscript/gdscript_basics.rst
A Thousand Ships 11 months ago
parent
commit
d57d5f894e
1 changed files with 7 additions and 4 deletions
  1. 7 4
      tutorials/scripting/gdscript/gdscript_basics.rst

+ 7 - 4
tutorials/scripting/gdscript/gdscript_basics.rst

@@ -1293,6 +1293,9 @@ a dictionary can also be used with a named enum.
         # prints '[0, 5, 6]'
         # prints '[0, 5, 6]'
         print(State.values())
         print(State.values())
 
 
+If not assigning a value to a key of an enum it will be assigned the previous value plus one,
+or ``0`` if it is the first entry in the enum. Multiple keys with the same value are allowed.
+
 
 
 Functions
 Functions
 ~~~~~~~~~
 ~~~~~~~~~
@@ -1897,10 +1900,10 @@ If you want to use ``extends`` too, you can keep both on the same line::
 
 
 .. warning::
 .. warning::
 
 
-    The Godot editor will hide these custom classes with names that beging with the prefix
-    "Editor" in the 'Create New Node' or 'Create New Scene' dialog windows. The classes 
-    are available for instantiation at runtime via their class names, but are 
-    automatically hidden by the editor windows along with the built-in editor nodes used 
+    The Godot editor will hide these custom classes with names that begin with the prefix
+    "Editor" in the 'Create New Node' or 'Create New Scene' dialog windows. The classes
+    are available for instantiation at runtime via their class names, but are
+    automatically hidden by the editor windows along with the built-in editor nodes used
     by the Godot editor.
     by the Godot editor.
 
 
 Inheritance
 Inheritance