MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / RenderText

Method RenderText

imgui_tiny_app/imgui/imgui.cpp:3896–3920  ·  view source on GitHub ↗

Internal ImGui functions to render text RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()

Source from the content-addressed store, hash-verified

3894// Internal ImGui functions to render text
3895// RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
3896void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash)
3897{
3898 ImGuiContext& g = *GImGui;
3899 ImGuiWindow* window = g.CurrentWindow;
3900
3901 // Hide anything after a '##' string
3902 const char* text_display_end;
3903 if (hide_text_after_hash)
3904 {
3905 text_display_end = FindRenderedTextEnd(text, text_end);
3906 }
3907 else
3908 {
3909 if (!text_end)
3910 text_end = text + ImStrlen(text); // FIXME-OPT
3911 text_display_end = text_end;
3912 }
3913
3914 if (text != text_display_end)
3915 {
3916 window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_display_end);
3917 if (g.LogEnabled)
3918 LogRenderedText(&pos, text, text_display_end);
3919 }
3920}
3921
3922void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width)
3923{

Callers 1

InputTextExMethod · 0.45

Calls 1

AddTextMethod · 0.80

Tested by

no test coverage detected