git repos / blockattack-game

commit 95e9e364

Poul Sander · 2023-11-11 14:55
95e9e36459a99e76e748c49eabc817ace231b76a patch · browse files
parent 75e8dcd85ee2e2dafcbfd8c70882f7bdb839cbac

Aligned the fps counter in both 4:3 and 16:9

Changed files

M source/code/MenuSystem.cpp before
M source/code/main.cpp before
diff --git a/source/code/MenuSystem.cpp b/source/code/MenuSystem.cpp index 51e4c56..c9004a9 100644 --- a/source/code/MenuSystem.cpp +++ b/source/code/MenuSystem.cpp
@@ -271,7 +271,7 @@ void Menu::Draw(SDL_Renderer* target) {
Ticks = SDL_GetTicks();
}
fpsField.SetText(FPS);
- fpsField.Draw(globalData.screen, 800, 4);
+ fpsField.Draw(globalData.screen, globalData.xsize - 4, 4, sago::SagoTextField::Alignment::right, sago::SagoTextField::VerticalAlignment::top);
#endif
}
void Menu::ProcessInput(const SDL_Event& event, bool& processed) {
diff --git a/source/code/main.cpp b/source/code/main.cpp index 896a6ff..afb9947 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -683,7 +683,7 @@ void DrawEverything(int xsize, int ysize,BlockGameSdl* theGame, BlockGameSdl* th
Ticks = SDL_GetTicks();
}
fpsField.SetText(FPS);
- fpsField.Draw(globalData.screen, 800, 4);
+ fpsField.Draw(globalData.screen, globalData.xsize - 4, 4, sago::SagoTextField::Alignment::right, sago::SagoTextField::VerticalAlignment::top);
#endif
}