-
Notifications
You must be signed in to change notification settings - Fork 29
Fields
Modar Nasser edited this page Feb 26, 2024
·
3 revisions
-
Enums
-
Struct and classes
-
Types
Contains enum values representing all the possible types of a Field.
- Int
- Float
- Bool
- String
- Color
- Point
- Enum
- FilePath
- EntityRef
- ArrayInt
- ArrayFloat
- ArrayBool
- ArrayString
- ArrayColor
- ArrayPoint
- ArrayEnum
- ArrayFilePath
- ArrayEntityRef
These enum values can be used to get a field from an Entity:
const auto& field_value = entity.getField<ldtk::FieldType::ArrayEntityRef>();
// The field_value variable will be a ldtk::ArrayField<ldtk::EntityRef>ldtk::FieldType ldtk::FieldDef::type;Type of the Field defined by the FieldDef.
std::string ldtk::FieldDef::name;Name of the Field defined by the FieldDef.
Mainly for internal use
template<FieldType T>
using getFieldType = typename field_type_from_enum_<T>::type;Utility used to get the underlying type from a FieldType enum value.
For example, to get the underlying type of a ldtk::FieldType::ArrayColor field, you can use ldtk::getFieldType<ldtk::FieldType::ArrayColor>.