Animation tool now lets you cycle through different sequence/transform 'forms' and shows you which one you're viewing.
This commit is contained in:
parent
07b2102f59
commit
4356b1535e
5 changed files with 170 additions and 56 deletions
|
|
@ -16,6 +16,8 @@ namespace animator {
|
|||
enum class Event {
|
||||
TICK=__LINE__,
|
||||
PLAY_STOP=__LINE__,
|
||||
NEXT_FORM=__LINE__,
|
||||
PREV_FORM=__LINE__,
|
||||
RELOAD=__LINE__,
|
||||
};
|
||||
|
||||
|
|
@ -23,11 +25,13 @@ namespace animator {
|
|||
|
||||
struct UI {
|
||||
guecs::UI $ui;
|
||||
guecs::UI $overlay;
|
||||
|
||||
void button(const std::string& name, std::function<void(guecs::Modifiers mods)> cb);
|
||||
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);
|
||||
void update_status(animate2::Animate2& anim);
|
||||
std::shared_ptr<sf::Sprite> get_sprite();
|
||||
};
|
||||
|
||||
|
|
@ -44,6 +48,8 @@ namespace animator {
|
|||
std::string $background="";
|
||||
std::filesystem::file_time_type $last_mod_time;
|
||||
sf::Clock $timer;
|
||||
std::string $cur_form = "idle";
|
||||
int $cur_form_i = 0;
|
||||
|
||||
void init(const std::string &sprite_name, const std::string& background, const std::string &anim_name);
|
||||
void event(Event ev, std::any data={});
|
||||
|
|
@ -58,6 +64,7 @@ namespace animator {
|
|||
void tick();
|
||||
void reload();
|
||||
void check_update();
|
||||
void change_form(int direction);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue