Animation motion() almost works but need to tweak the calculations so they go for the length of the animation?

This commit is contained in:
Zed A. Shaw 2026-01-21 23:53:13 -05:00
parent 60c405b1fc
commit 31b815d43e
3 changed files with 23 additions and 17 deletions

View file

@ -23,6 +23,7 @@ namespace animate2 {
int loop_count{0};
size_t frame_count{frames.size()};
sf::Clock timer{};
float subframe{0.0f};
};
struct Transform {
@ -34,6 +35,7 @@ namespace animate2 {
bool simple{true};
bool flipped{false};
float ease_rate{0.5f};
float speed{0.1f};
bool scaled{false};
bool stationary{false};
// these can handled by the onLoop, same as ganim8 does it
@ -75,7 +77,7 @@ namespace animate2 {
void apply(sf::Sprite& sprite);
void update_frame();
void update();
void motion(sf::Vector2f& pos, sf::Vector2f& scale);
void motion(sf::Vector2f& pos_out, sf::Vector2f& scale_out);
};
}