background

This commit is contained in:
2026-03-18 08:49:19 +01:00
parent e4004bbfe8
commit fa4a2b9924

View File

@@ -9,8 +9,8 @@ namespace Game::AGame {
int w, h;
SDL_GetWindowSizeInPixels(Window::Window::getSDLWindowBackend(), &w, &h);
mTransform.scaleX *= 5.f;
mTransform.scaleY *= 5.f;
mTransform.scaleX *= 10.f;
mTransform.scaleY *= 10.f;
mTransform.x -= mTex->getWidth() * mTransform.adjustedScaleX() / 2.f;
mTransform.y -= mTex->getHeight() * mTransform.adjustedScaleY() / 2.f;
@@ -18,10 +18,8 @@ namespace Game::AGame {
LOG("W: " << w << " H: " << h);
mTransform.x = w / 2.f - (w / 3.f);
mTransform.y = 0.f;
mTransform.y = -h;
mTransform.scaleX = 1.f;
mTransform.scaleY = 1.f;
mSound.~Sound();
}
@@ -47,6 +45,6 @@ namespace Game::AGame {
void Background::onWindowResized(int newWidth, int newHeight) {
// Re-center the background on window resize
mTransform.x = newWidth / 2.f - (newWidth / 3.f);
mTransform.y = 0.f;
mTransform.y = -newHeight;
}
}