Can now specify a background to render the sprite on.
This commit is contained in:
parent
fc01579232
commit
77643a4bcd
3 changed files with 85 additions and 10 deletions
|
|
@ -25,7 +25,7 @@ namespace animator {
|
|||
guecs::UI $ui;
|
||||
|
||||
void button(const std::string& name, std::function<void(guecs::Modifiers mods)> cb);
|
||||
void init(const std::string& sprite_name, int width, int height);
|
||||
void init(const std::string& sprite_name, const std::string& background, int width, int height);
|
||||
void render(sf::RenderWindow& window, bool debug=false);
|
||||
bool mouse(float x, float y, guecs::Modifiers mods);
|
||||
std::shared_ptr<sf::Sprite> get_sprite();
|
||||
|
|
@ -40,10 +40,12 @@ namespace animator {
|
|||
std::shared_ptr<sf::Sprite> $sprite = nullptr;
|
||||
animate2::Animate2 $anim;
|
||||
std::string $sprite_name="";
|
||||
std::string $anim_name="";
|
||||
std::string $background="";
|
||||
std::filesystem::file_time_type $last_mod_time;
|
||||
sf::Clock $timer;
|
||||
|
||||
void init(const std::string &sprite_name);
|
||||
void init(const std::string &sprite_name, const std::string& background, const std::string &anim_name);
|
||||
void event(Event ev, std::any data={});
|
||||
void START(Event ev);
|
||||
void ANIMATE(Event ev);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue