background
This commit is contained in:
@@ -9,8 +9,8 @@ namespace Game::AGame {
|
|||||||
int w, h;
|
int w, h;
|
||||||
SDL_GetWindowSizeInPixels(Window::Window::getSDLWindowBackend(), &w, &h);
|
SDL_GetWindowSizeInPixels(Window::Window::getSDLWindowBackend(), &w, &h);
|
||||||
|
|
||||||
mTransform.scaleX *= 5.f;
|
mTransform.scaleX *= 10.f;
|
||||||
mTransform.scaleY *= 5.f;
|
mTransform.scaleY *= 10.f;
|
||||||
|
|
||||||
mTransform.x -= mTex->getWidth() * mTransform.adjustedScaleX() / 2.f;
|
mTransform.x -= mTex->getWidth() * mTransform.adjustedScaleX() / 2.f;
|
||||||
mTransform.y -= mTex->getHeight() * mTransform.adjustedScaleY() / 2.f;
|
mTransform.y -= mTex->getHeight() * mTransform.adjustedScaleY() / 2.f;
|
||||||
@@ -18,10 +18,8 @@ namespace Game::AGame {
|
|||||||
LOG("W: " << w << " H: " << h);
|
LOG("W: " << w << " H: " << h);
|
||||||
|
|
||||||
mTransform.x = w / 2.f - (w / 3.f);
|
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();
|
mSound.~Sound();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +45,6 @@ namespace Game::AGame {
|
|||||||
void Background::onWindowResized(int newWidth, int newHeight) {
|
void Background::onWindowResized(int newWidth, int newHeight) {
|
||||||
// Re-center the background on window resize
|
// Re-center the background on window resize
|
||||||
mTransform.x = newWidth / 2.f - (newWidth / 3.f);
|
mTransform.x = newWidth / 2.f - (newWidth / 3.f);
|
||||||
mTransform.y = 0.f;
|
mTransform.y = -newHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user