Camera for the storyboard can now do pan, bounce, dolly, and shake.

This commit is contained in:
Zed A. Shaw 2025-11-09 11:41:11 -05:00
parent 0d326089f7
commit 29409c54ce
5 changed files with 23 additions and 15 deletions

View file

@ -40,15 +40,22 @@ namespace cinematic {
anim = MGR.animations.at(name);
}
void Camera::position(float x, float y) {
anim.min_x = x;
anim.min_y = y;
void Camera::focus(float x, float y) {
position.x = x;
position.y = y;
}
void Camera::move(sf::RenderTexture& target, sf::Vector2f pos) {
sf::View zoom;
anim.max_x = pos.x;
anim.max_y = pos.y;
// BUG: annoying special case
if(anim.motion == ease::SLIDE) {
anim.min_x = position.x;
anim.min_y = position.y;
anim.max_x = pos.x;
anim.max_y = pos.y;
}
anim.apply(zoom, pos, size);
target.setView(zoom);
}