| 22 | } |
| 23 | |
| 24 | void utils::TextCentered(std::string text, int type = 0) |
| 25 | { |
| 26 | auto windowWidth = ImGui::GetWindowSize().x; |
| 27 | auto textWidth = ImGui::CalcTextSize(text.c_str()).x; |
| 28 | |
| 29 | ImGui::SetCursorPosX((windowWidth - textWidth) * 0.5f); |
| 30 | switch (type) |
| 31 | { |
| 32 | case 0: |
| 33 | ImGui::TextUnformatted(text.c_str()); |
| 34 | break; |
| 35 | |
| 36 | case 1: |
| 37 | ImGui::TextDisabled("%s", text.c_str()); |
| 38 | break; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | float utils::RandomFloat(float a, float b) |
| 43 | { |