Ease2 is the new way to do easing functions.

This commit is contained in:
Zed A. Shaw 2026-01-22 22:32:13 -05:00
parent 31b815d43e
commit c0f69ed026
9 changed files with 151 additions and 75 deletions

View file

@ -1,12 +1,12 @@
#pragma once
#include <memory>
#include <chrono>
#include "easings.hpp"
#include <SFML/Graphics/Rect.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/System/Time.hpp>
#include <functional>
#include "ease2.hpp"
namespace animate2 {
struct Sheet {
@ -44,11 +44,11 @@ namespace animate2 {
std::shared_ptr<sf::Shader> shader{nullptr};
// change to using a callback function for these
ease::Style easing = ease::IN_OUT_BACK;
ease::Motion motion = ease::RUSH;
ease2::EaseFunc easing = ease2::in_out_back;
ease2::MoveFunc motion = ease2::move_rush;
float twitching(Sequence& seq);
void lerp(Sequence& seq, sf::Vector2f& scale_out, sf::Vector2f& pos_out);
void lerp(Sequence& seq, sf::Vector2f& pos_out, sf::Vector2f& scale_out);
};
/* Gets the number of times it looped, and returns if it should stop. */