Skip to content

Commit 2d792b4

Browse files
authored
Merge pull request #9872 from AThousandShips/enum_doc_improve
[GDScript] Clarify initialization of enum values
2 parents 9dbc6f8 + 0686612 commit 2d792b4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tutorials/scripting/gdscript/gdscript_basics.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,9 @@ a dictionary can also be used with a named enum.
12921292
# prints '[0, 5, 6]'
12931293
print(State.values())
12941294

1295+
If not assigning a value to a key of an enum it will be assigned the previous value plus one,
1296+
or ``0`` if it is the first entry in the enum. Multiple keys with the same value are allowed.
1297+
12951298

12961299
Functions
12971300
~~~~~~~~~
@@ -1897,9 +1900,9 @@ If you want to use ``extends`` too, you can keep both on the same line::
18971900
.. warning::
18981901

18991902
The Godot editor will hide these custom classes with names that begin with the prefix
1900-
"Editor" in the 'Create New Node' or 'Create New Scene' dialog windows. The classes
1901-
are available for instantiation at runtime via their class names, but are
1902-
automatically hidden by the editor windows along with the built-in editor nodes used
1903+
"Editor" in the 'Create New Node' or 'Create New Scene' dialog windows. The classes
1904+
are available for instantiation at runtime via their class names, but are
1905+
automatically hidden by the editor windows along with the built-in editor nodes used
19031906
by the Godot editor.
19041907

19051908
Inheritance

0 commit comments

Comments
 (0)