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

namuda picture namuda  路  3Comments

bogdaNNNN1 picture bogdaNNNN1  路  3Comments

GrammarLord picture GrammarLord  路  3Comments

ocornut picture ocornut  路  3Comments

DarkLinux picture DarkLinux  路  3Comments