Same problem with background.
This commit is contained in:
parent
e88179b788
commit
31adf011ef
2 changed files with 3 additions and 1 deletions
|
|
@ -103,6 +103,7 @@ namespace guecs {
|
||||||
sf::Color color=THEME.BG_COLOR;
|
sf::Color color=THEME.BG_COLOR;
|
||||||
shared_ptr<sf::RectangleShape> shape = nullptr;
|
shared_ptr<sf::RectangleShape> shape = nullptr;
|
||||||
shared_ptr<sf::Sprite> sprite = nullptr;
|
shared_ptr<sf::Sprite> sprite = nullptr;
|
||||||
|
shared_ptr<sf::Texture> texture = nullptr;
|
||||||
|
|
||||||
Background(lel::Parser& parser, sf::Color bg_color=THEME.BG_COLOR) :
|
Background(lel::Parser& parser, sf::Color bg_color=THEME.BG_COLOR) :
|
||||||
x(parser.grid_x),
|
x(parser.grid_x),
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,8 @@ namespace guecs {
|
||||||
auto sprite_texture = BACKEND->get_sprite(name);
|
auto sprite_texture = BACKEND->get_sprite(name);
|
||||||
|
|
||||||
sf::IntRect rect{{0,0},sprite_texture.frame_size};
|
sf::IntRect rect{{0,0},sprite_texture.frame_size};
|
||||||
sprite = make_shared<sf::Sprite>(*sprite_texture.texture, rect);
|
texture = sprite_texture.texture;
|
||||||
|
sprite = make_shared<sf::Sprite>(*texture, rect);
|
||||||
|
|
||||||
sprite->setPosition({float(x), float(y)});
|
sprite->setPosition({float(x), float(y)});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue