1

I wanted to do this in my project, so I first tried to implement this in the imgui examples project.

I'm implementing in glfw_opengl2.cpp file

bool btn1 = ImGui::ImageButton((void*)(intptr_t)my_image_texture, { 40.0f,40.0f });
if(ImGui::IsItemHovered())
    //what to add here?               
if(btn1)
    counter++;
ImGui::SameLine();
ImGui::Text("counter = %d", counter); 

So what option is there only to change the size, so hovering on it it becomes highlighted?

If I can't change the size of ImageButton can I add a border around it to indicate that it is selected?

One more question, can I change border property of a child window on hover?

ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, Dp2Px(5.0f));
//Currently border is false in below line
ImGui::BeginChild(childId.c_str(), ImVec2(Dp2Px(85), Dp2Px(48)), false, window_flags);
ImGui::PopStyleVar();
isClicked = ImGui::ImageButton((void*)(intptr_t)icons[i], ImVec2(45, 30));
//on hover the border of BeginChild() should appear

0 Answers0