Enumerations (Enums) are special value types for Entities. They could be for example the list of possible Enemy types, or a list of Item identifiers.
Examples:
- enum “EnemyType” with values: “Zombie”, “Skeleton”, “Ghost”…
- enum “ItemType” with values: “Ammo”, “HealthPotion”, “Key”…

Enum types
Local enums
Local enums are created and filled directly from the LDtk enum panel.
Extern enums
For Haxe users, you can directly import a HX source file to use all (non-parametered) enums declared inside. LDtk will keep the enums synced and they will even be accessible later in your code through the Haxe API, with all the cool type-safe consequences you can imagine.
For example, if you have the following MyTypes.hx
file, you can import it to LDtk enums. Status
and EnemyGrade
will then be available as entity field types.
package whatever;
enum Status {
Visible;
Hidden;
Sleeping;
}
enum EnemyGrade {
Normal;
Elite;
Boss;
}