Animation motion() almost works but need to tweak the calculations so they go for the length of the animation?
This commit is contained in:
parent
60c405b1fc
commit
31b815d43e
3 changed files with 23 additions and 17 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue