#include <PauseMenu.hxx>
|
virtual void | draw () const override |
|
Definition at line 6 of file PauseMenu.hxx.
◆ draw()
void PauseMenu::draw |
( |
| ) |
const |
|
overridevirtual |
Reimplemented from GameMenu.
Definition at line 13 of file PauseMenu.cxx.
15 ImVec2 windowSize(300, 400);
16 ImVec2 screenSize = ui::GetIO().DisplaySize;
24 const auto &layout = uiManager.getLayouts()[
"PauseMenuButtons"];
25 ui::SetNextWindowPos(ImVec2((screenSize.x - windowSize.x) / 2, (screenSize.y - windowSize.y) / 2));
26 ui::SetNextWindowSize(windowSize);
28 const ImVec2 buttonSize(200, 40);
29 const ImVec2 buttonOffset((windowSize.x - buttonSize.x) / 2, buttonSize.y / 2);
31 ui::PushFont(layout.font);
32 ui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
33 ui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
34 ui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(buttonOffset.x, 0));
35 ui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, buttonOffset.y));
38 ui::BeginCt(
"PauseMenu", &open,
39 ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar |
40 ImGuiWindowFlags_NoScrollWithMouse);
42 ui::Dummy({0.f, (windowSize.y - (buttonSize.y + buttonOffset.y) * 5) / 2});
43 if (ui::ButtonCt(
"Settings", buttonSize))
49 if (ui::ButtonCt(
"New Game", buttonSize))
54 if (ui::ButtonCt(
"Save Game", buttonSize))
59 if (ui::ButtonCt(
"Load Game", buttonSize))
64 if (ui::ButtonCt(
"Quit Game", buttonSize))
The documentation for this struct was generated from the following files: