Making Icons a thing again since it's convenient.

This commit is contained in:
Zed A. Shaw 2025-07-23 13:49:16 -04:00
parent 7e64879f78
commit 4c019048d0
4 changed files with 35 additions and 1 deletions

View file

@ -36,6 +36,20 @@ namespace guecs {
void render(sf::RenderWindow& window, sf::Shader *shader_ptr);
};
struct Icon : public Sprite {
template<typename... Args>
Icon(Args... args) : Sprite(args...)
{
stretch = false;
is_icon = true;
}
Icon() {
stretch = false;
is_icon = true;
};
};
struct Rectangle {
int padding = THEME.PADDING;
sf::Color color = THEME.FILL_COLOR;

View file

@ -218,6 +218,7 @@ namespace guecs {
sf::Shader* find_shader(Entity ent, bool is_shape);
void show_sprite(const string& region, const string& sprite_name);
void show_icon(const string& region, const string& sprite_name);
void show_text(const string& region, const wstring& content);
void show_label(const string& region, const wstring& content);
};