We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version/Branch of Dear ImGui:
Version: 1.86 Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_dx11.cpp + imgui_impl_win32.cpp Compiler: VS C++ 17 Operating System: Win 8.1 x64
My Issue/Question:
Is it possible to hope for the developing of text hover style?
The text was updated successfully, but these errors were encountered:
You can create your own widget easily for that.
Sorry, something went wrong.
Here's a potential solution that handles formatting:
header
namespace ImGui { void TextWithHoverColor(ImVec4 col, const char* fmt, ...); };
implementation
#include "imgui_internal.h" void ImGui::TextWithHoverColor(ImVec4 col, const char* fmt, ...) { ImGuiContext& g = *GImGui; ImGuiWindow* window = GetCurrentWindow(); if (window->SkipItems) return; // Format text va_list args; va_start(args, fmt); const char* text_begin = g.TempBuffer; const char* text_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args); va_end(args); // Layout const ImVec2 text_pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset); const ImVec2 text_size = CalcTextSize(text_begin, text_end); ImRect bb(text_pos.x, text_pos.y, text_pos.x + text_size.x, text_pos.y + text_size.y); ItemSize(text_size, 0.0f); if (!ItemAdd(bb, 0)) return; // Render bool hovered = IsItemHovered(); if (hovered) PushStyleColor(ImGuiCol_Text, col); RenderText(bb.Min, text_begin, text_end, false); if (hovered) PopStyleColor(); }
Also linking to #511 #2941
No branches or pull requests
Version/Branch of Dear ImGui:
Version: 1.86
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_dx11.cpp + imgui_impl_win32.cpp
Compiler: VS C++ 17
Operating System: Win 8.1 x64
My Issue/Question:
Is it possible to hope for the developing of text hover style?
The text was updated successfully, but these errors were encountered: