MCPcopy Create free account
hub / github.com/Raais/ImStudio / TextCentered

Method TextCentered

src/utils/ims_utils.cpp:24–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void 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
42float utils::RandomFloat(float a, float b)
43{

Callers

nothing calls this directly

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected