Moved the camera into the scene where it belongs.

This commit is contained in:
Zed A. Shaw 2025-12-29 23:37:42 -05:00
parent c71566048e
commit 5676382fbb
5 changed files with 29 additions and 27 deletions

View file

@ -22,7 +22,6 @@ namespace boss {
$view_sprite($view_texture.getTexture())
{
$view_sprite.setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
$camera.style("shake");
}
void UI::init() {
@ -80,7 +79,6 @@ namespace boss {
$combat_ui.render(*$window);
$arena.render($view_texture);
$camera.render($view_texture);
$view_texture.display();
$window->draw($view_sprite);
}
@ -115,17 +113,4 @@ namespace boss {
$arena.apply_effect(actor, "flame");
}
}
void UI::zoom(const std::string &cell_name, double ratio) {
if(cell_name == "") {
dbc::log("!!!!!!!!! you should add this to guecs");
$camera.reset($view_texture, BOSS_VIEW_WIDTH, BOSS_VIEW_HEIGHT);
} else {
auto& cell = $arena.$ui.cell_for(cell_name);
$camera.resize(double(BOSS_VIEW_WIDTH)/ratio, double(BOSS_VIEW_HEIGHT)/ratio);
$camera.move(float(cell.mid_x), float(cell.mid_y));
$camera.play();
}
}
}