fixed position
This commit is contained in:
@ -239,10 +239,6 @@ void LevelSelectorState::drawLevelSelectionPopup(SDL_Renderer* renderer) {
|
||||
float vw = (lastLogicalScale > 0.f) ? float(lastLogicalVP.w) / lastLogicalScale : float(LOGICAL_W);
|
||||
float vh = (lastLogicalScale > 0.f) ? float(lastLogicalVP.h) / lastLogicalScale : float(LOGICAL_H);
|
||||
|
||||
// Dim overlay over whatever background main already drew.
|
||||
//FillRect(renderer, SDL_FRect{0, 0, (float)vw, (float)vh}, SDL_Color{0, 0, 0, 120});
|
||||
//Vignette(renderer, vw, vh);
|
||||
|
||||
// compute horizontal offset so content centers within the visible logical viewport
|
||||
float offX = 0.f;
|
||||
if (lastLogicalScale > 0.f) {
|
||||
@ -251,14 +247,11 @@ void LevelSelectorState::drawLevelSelectionPopup(SDL_Renderer* renderer) {
|
||||
}
|
||||
|
||||
// Panel and title strip (in logical space)
|
||||
SDL_FRect panel = DrawPanel(renderer, vw, vh, /*draw=*/true, offX, 0.f);
|
||||
SDL_FRect panel = DrawPanel(renderer, vw, vh-140.0f, /*draw=*/true, offX, 0.f);
|
||||
|
||||
// Glow strip behind title (raised higher)
|
||||
//SDL_FRect strip{ (float)vw / 2.f + offX - panel.w / 2.f, panel.y - 80.f, panel.w, 30.f };
|
||||
//FillRect(renderer, strip, SDL_Color{255, 204, 51, 28});
|
||||
|
||||
// Title text
|
||||
DrawText(renderer, ctx.font, "SELECT STARTING LEVEL", vw / 2.f + offX, panel.y - 90.f, 2.4f, COL_TITLE, true, true);
|
||||
// Title text - prefer pixelFont for a blocky title if available, fallback to regular font
|
||||
FontAtlas* titleFont = ctx.pixelFont ? ctx.pixelFont : ctx.font;
|
||||
DrawText(renderer, titleFont, "SELECT STARTING LEVEL", vw / 2.f + offX, panel.y + 20.f, 1.2f, COL_TITLE, true, true);
|
||||
|
||||
// Grid of levels
|
||||
Grid g = MakeGrid(panel);
|
||||
@ -268,8 +261,9 @@ void LevelSelectorState::drawLevelSelectionPopup(SDL_Renderer* renderer) {
|
||||
DrawCell(renderer, rc, i, hoveredLevel == i, selectedLevel == i);
|
||||
}
|
||||
|
||||
// Footer/instructions
|
||||
DrawText(renderer, ctx.font, "CLICK A LEVEL TO SELECT \u2022 ESC = CANCEL",
|
||||
// Footer/instructions - use regular TTF font for readability
|
||||
FontAtlas* footerFont = ctx.pixelFont ? ctx.pixelFont : ctx.font;
|
||||
DrawText(renderer, footerFont, "CLICK A LEVEL TO SELECT \u2022 ESC = CANCEL",
|
||||
vw / 2.f + offX, vh - 56.f, 1.0f, COL_FOOTER, true, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user