Internal ImGui functions to render text RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
| 3894 | // Internal ImGui functions to render text |
| 3895 | // RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText() |
| 3896 | void 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 | |
| 3922 | void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) |
| 3923 | { |