KROYSDOCS
HomeWhat's newv0.1.0
C/C++ SDK / C++ layer · Scene / kroys::ComponentTypeBuilder

kroys::ComponentTypeBuilder

Builds a component type description (fields keep their strings alive).

Kindclass
Headerkroys/plugin.hpp
Members13
DECLARATION

Declaration

Declared in kroys/plugin.hpp.

plugin.hpp
class ComponentTypeBuilder
REFERENCE

Members

Constructors
#ComponentTypeBuilder(std::string name, std::string displayName = {}, std::string category = {});

Starts a type named name (engine type "<plugin id>.<name>") with an inspector name and an Add Component category.

constructor
Methods
#ComponentTypeBuilder& Description(std::string text);

Add Component tooltip.

method
#ComponentTypeBuilder& Version(uint32_t schemaVersion);

Schema version (>= 1) of the saved records.

method
#ComponentTypeBuilder& Flags(uint32_t flags);

KROYS_COMPONENT_* flags.

method
#ComponentTypeBuilder& Bool(const std::string& name, bool value, const std::string& label = {}, const std::string& tooltip = {});

Adds a BOOL field with its default, inspector label and tooltip.

method
#ComponentTypeBuilder& Int(const std::string& name, int32_t value, const std::string& label = {}, const std::string& tooltip = {});

Adds an INT field.

method
#ComponentTypeBuilder& Float(const std::string& name, float value, const std::string& label = {}, const std::string& tooltip = {});

Adds a FLOAT field.

method
#ComponentTypeBuilder& Vector3(const std::string& name, Vec3 value, const std::string& label = {}, const std::string& tooltip = {});

Adds a VEC3 field.

method
#ComponentTypeBuilder& Color(const std::string& name, float r, float g, float b, float a = 1.0f, const std::string& label = {});

Adds an RGBA colour field (VEC4 with KROYS_FIELD_COLOR).

method
#ComponentTypeBuilder& String(const std::string& name, const std::string& value, const std::string& label = {}, const std::string& tooltip = {});

Adds a STRING field.

method
#ComponentTypeBuilder& Range(float minimum, float maximum);

Modifies the last field.

method
#ComponentTypeBuilder& FieldFlags(uint32_t flags);

Adds KROYS_FIELD_* flags to the last field.

method
#[[nodiscard]] KroysComponentTypeDesc Desc() const;

The C description for core->RegisterComponentType (valid while the builder lives).

method
Signatures
ComponentTypeBuilder(std::string name, std::string displayName = {}, std::string category = {});
ComponentTypeBuilder& Description(std::string text);
ComponentTypeBuilder& Version(uint32_t schemaVersion);
ComponentTypeBuilder& Flags(uint32_t flags);
ComponentTypeBuilder& Bool(const std::string& name, bool value, const std::string& label = {}, const std::string& tooltip = {});
ComponentTypeBuilder& Int(const std::string& name, int32_t value, const std::string& label = {}, const std::string& tooltip = {});
ComponentTypeBuilder& Float(const std::string& name, float value, const std::string& label = {}, const std::string& tooltip = {});
ComponentTypeBuilder& Vector3(const std::string& name, Vec3 value, const std::string& label = {}, const std::string& tooltip = {});
ComponentTypeBuilder& Color(const std::string& name, float r, float g, float b, float a = 1.0f, const std::string& label = {});
ComponentTypeBuilder& String(const std::string& name, const std::string& value, const std::string& label = {}, const std::string& tooltip = {});
ComponentTypeBuilder& Range(float minimum, float maximum);
ComponentTypeBuilder& FieldFlags(uint32_t flags);
[[nodiscard]] KroysComponentTypeDesc Desc() const;

KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.