Imgui: How to make the text behind the image button align to the image button?

Created on 6 Sep 2018  路  4Comments  路  Source: ocornut/imgui

just like title.I have not found the way to do that in the "ShowDemoWindow"
2018-09-06 17-54-39

Most helpful comment

Without C++11 you can ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x, ImGui::GetCursorPos().y + (yourImageHeight - ImGui::GetFont()->FontSize) / 2))

All 4 comments

Before drawing the text, do ImGui::SetCursorPos({ImGui::GetCursorPos().x, ImGui::GetCursorPos().y + (yourImageHeight - ImGui::GetFont()->FontSize) / 2})

Without C++11 you can ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x, ImGui::GetCursorPos().y + (yourImageHeight - ImGui::GetFont()->FontSize) / 2))

Does my previous code solve your problem? If so, close this please.

Yes, Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mnemode2 picture mnemode2  路  3Comments

ocornut picture ocornut  路  3Comments

the-lay picture the-lay  路  3Comments

noche-x picture noche-x  路  3Comments

Folling picture Folling  路  3Comments