Now Sprite can do either aspect_ratio scaling or stretching and Icon is just a subclass.
This commit is contained in:
parent
b7cfa4db2d
commit
a22342cd7e
3 changed files with 13 additions and 43 deletions
|
@ -40,6 +40,7 @@ namespace guecs {
|
|||
struct Sprite {
|
||||
string name;
|
||||
int padding = THEME.PADDING;
|
||||
bool stretch = false;
|
||||
std::shared_ptr<sf::Sprite> sprite = nullptr;
|
||||
|
||||
void init(lel::Cell &cell);
|
||||
|
@ -47,15 +48,7 @@ namespace guecs {
|
|||
void render(sf::RenderWindow& window, sf::Shader *shader_ptr);
|
||||
};
|
||||
|
||||
struct Icon {
|
||||
string name;
|
||||
int padding = THEME.PADDING;
|
||||
std::shared_ptr<sf::Sprite> sprite = nullptr;
|
||||
|
||||
void init(lel::Cell &cell);
|
||||
void update(const string& new_name);
|
||||
void render(sf::RenderWindow& window, sf::Shader *shader_ptr);
|
||||
};
|
||||
struct Icon : public Sprite { };
|
||||
|
||||
struct Rectangle {
|
||||
int padding = THEME.PADDING;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue