Better working camera that is constrained in the bounds, but the animations don't follow the bounding.

This commit is contained in:
Zed A. Shaw 2026-01-01 12:59:39 -05:00
parent 6dc9d564c6
commit 51bb74e2d7
9 changed files with 93 additions and 33 deletions

View file

@ -93,13 +93,11 @@ namespace storyboard {
void UI::zoom(const std::string &cell_name) {
auto& cell = $ui.cell_for(cell_name);
$camera.resize(float(cell.w), float(cell.h));
$camera.resize(float(cell.w));
$camera.move(float(cell.mid_x), float(cell.mid_y));
}
void UI::reset() {
sf::FloatRect where{{0,0},{SCREEN_WIDTH, SCREEN_HEIGHT}};
sf::View view{where};
$view_texture.setView(view);
$camera.reset($view_texture);
}
}

View file

@ -10,7 +10,7 @@ namespace storyboard {
guecs::UI $ui;
sf::RenderTexture $view_texture;
sf::Sprite $view_sprite;
cinematic::Camera $camera;
cinematic::Camera $camera{{SCREEN_WIDTH, SCREEN_HEIGHT}};
std::shared_ptr<sf::Sound> $audio;
std::string $zoom_target = "a";
bool $moving = false;