0 votes

What are the enumerations? I saw that they are named in the documentation

in Engine by (195 points)

1 Answer

0 votes

enumerations or short enum are a collection of numbered literal constants.

Just like

const MY_CONST = 234

but enums are defiened differently


then TILEBRICK would be 0 TILEWATER = 1 and so on

If you would want more structured code you can do


Then tiles.TILE_BRICK would be 0 etc.

and since they are constant they are static too
MyCustomClass.tiles.TILE_BRICK is also accessible

by (4,078 points)
edited by

I could do it with the body entered signal of an area to detect when there is something over this?

How do we know enums are static? I can make another question if need be.

Well ... they are. Like any other constant in gd script

Ok, thank you :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.