9#ifndef RTYPE_CLIENT_GRAPHICS_UIFACTORY_HPP_
10#define RTYPE_CLIENT_GRAPHICS_UIFACTORY_HPP_
93 const std::string &label,
94 std::function<
void()> onClick =
nullptr);
118 const std::string &content,
const std::string &fontPath,
119 unsigned int fontSize,
const std::uint8_t zIndex = 0,
120 const color &textColor = {255, 255, 255});
149 float minValue,
float maxValue,
151 std::function<
void(
float)> onChange =
nullptr);
177 const size &
size,
const std::vector<std::string> &options,
178 const int selectedIndex,
179 std::function<
void(
int index)> onSelect =
nullptr);
209 const size &
size,
const std::string &fontPath,
210 unsigned int fontSize,
const int maxLength = 64,
211 const std::string &placeholder =
"",
212 std::function<
void(
const std::string &)> onSubmit =
nullptr,
213 std::function<
void(
const std::string &)> onChange =
231 const std::string& texturePath,
Factory class for creating UI components in the ECS registry.
static ecs::Entity createTextInput(ecs::Registry ®istry, const position &position, const size &size, const std::string &fontPath, unsigned int fontSize, const int maxLength=64, const std::string &placeholder="", std::function< void(const std::string &)> onSubmit=nullptr, std::function< void(const std::string &)> onChange=nullptr)
static ecs::Entity createSpritePreview(ecs::Registry ®istry, const position &position, const std::string &texturePath, int rectLeft, int rectTop, int rectWidth, int rectHeight, float scale=2.0f, int zIndex=0)
Create a sprite preview UI component.
static ecs::Entity createText(ecs::Registry ®istry, const position &position, const std::string &content, const std::string &fontPath, unsigned int fontSize, const std::uint8_t zIndex=0, const color &textColor={255, 255, 255})
static ecs::Entity createButton(ecs::Registry ®istry, const position &position, const size &size, const std::string &label, std::function< void()> onClick=nullptr)
Create a button UI component.
static ecs::Entity createDropdown(ecs::Registry ®istry, const position &position, const size &size, const std::vector< std::string > &options, const int selectedIndex, std::function< void(int index)> onSelect=nullptr)
static ecs::Entity createSlider(ecs::Registry ®istry, const position &position, const size &size, float minValue, float maxValue, float initialValue, std::function< void(float)> onChange=nullptr)
Represents an entity in the ECS (Entity-Component-System) architecture.
Represents the position of a UI component.
Represents the size of a UI component.