Animations can now be applied to sf::View to do animated camera effects.

This commit is contained in:
Zed A. Shaw 2025-11-01 12:29:22 -04:00
parent d60e1af6df
commit f1f4cbc80f
4 changed files with 27 additions and 22 deletions

View file

@ -6,6 +6,7 @@
#include <SFML/Graphics/Rect.hpp>
#include <SFML/Graphics/Shader.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/View.hpp>
#include <SFML/System/Vector2.hpp>
#include <functional>
#include <optional>
@ -140,6 +141,8 @@ namespace components {
int frame_height = -1;
bool apply(sf::Sprite& target, sf::Vector2f pos);
bool apply(sf::View& view_out, sf::Vector2f pos, sf::Vector2f size);
void play();
float twitching();
void step(sf::Vector2f& scale_out, sf::Vector2f& pos_out, sf::IntRect& rect_out);