We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3119d34 + 795df85 commit 8209021Copy full SHA for 8209021
tutorials/scripting/gdscript/gdscript_basics.rst
@@ -1231,13 +1231,18 @@ a dictionary can also be used with a named enum.
1231
1232
# Is the same as:
1233
const State = {STATE_IDLE = 0, STATE_JUMP = 5, STATE_SHOOT = 6}
1234
+ # Access values with State.STATE_IDLE, etc.
1235
1236
func _ready():
1237
# Access values with Name.KEY, prints '5'
1238
print(State.STATE_JUMP)
1239
# Use constant dictionary functions
1240
# prints '["STATE_IDLE", "STATE_JUMP", "STATE_SHOOT"]'
1241
print(State.keys())
1242
+ # prints '["STATE_IDLE", "STATE_JUMP", "STATE_SHOOT"]'
1243
+ print(State)
1244
+ # prints '[0, 5, 6]'
1245
+ print(State.values())
1246
1247
1248
Functions
0 commit comments