When there's actions in the arena the camera moves.

This commit is contained in:
Zed A. Shaw 2025-11-22 14:53:52 -05:00
parent 63a17d7efa
commit d244106981
4 changed files with 52 additions and 14 deletions

View file

@ -56,6 +56,14 @@ namespace cinematic {
}
}
void Camera::reset(sf::RenderTexture& target, float width, float height) {
size = {width, height};
aimed_at = {width/2, height/2};
going_to = {width/2, height/2};
view = {aimed_at, size};
target.setView(target.getDefaultView());
}
void Camera::render(sf::RenderTexture& target) {
if(anim.playing) {
anim.apply(view, going_to, size);