Animations now have an easing/ease_rate setting that will do a dynamic scaling effect on them during the animation sequence.

This commit is contained in:
Zed A. Shaw 2025-03-01 00:24:19 -05:00
parent 6e363ba78d
commit 033358749f
8 changed files with 42 additions and 14 deletions

View file

@ -9,6 +9,7 @@
#include <functional>
#include <nlohmann/json.hpp>
#include <nlohmann/json_fwd.hpp>
#include "easings.hpp"
#define ENROLL_COMPONENT(COMPONENT, ...) \
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(COMPONENT, __VA_ARGS__); \
@ -105,8 +106,11 @@ namespace components {
int current = 0;
bool playing = false;
float subframe = 0;
ease::Style easing = ease::IN_OUT_BACK;
float ease_rate = 0.5f;
void play();
float twitching();
void step(sf::Vector2f& scale_out, sf::IntRect& rect_out);
};