Skip to content
New issue

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

No Hover Flags in ImGui::IsAnyItemHovered() #7571

Open
Iacaka opened this issue May 9, 2024 · 4 comments
Open

No Hover Flags in ImGui::IsAnyItemHovered() #7571

Iacaka opened this issue May 9, 2024 · 4 comments

Comments

@Iacaka
Copy link

Iacaka commented May 9, 2024

Version/Branch of Dear ImGui:

Version 1.94, Branch: docking

Back-ends:

imgui_impl_vulk.cpp + imgui_impl_glfw.cpp + custom vulk backend

Compiler, OS:

Windows 10

Full config/build information:

No response

Details:

I see no flags in the function for any item to be hovered. I have a issue with the sound engine where i want it to play only once if any item was hovered, but it repeatedly changes true/false. I thought i could use flags for the issue, but there are no ImGui_HoveredFlags in the function arguments. Maybe something to look forward to?

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

@ocornut
Copy link
Owner

ocornut commented May 9, 2024

I don’t understand what you actually need. Please clarify.

@Iacaka
Copy link
Author

Iacaka commented May 9, 2024

Oh. Sorry, i got something mixed up with the Button flags. It is entirely my fault. I just want ImGui::IsAnyItemHovered() to execute once for the whole duration that the item is hovered on.

I want a certain sound to play when any item is hovered on and it needs to be executed only once.

@ruby3141
Copy link

ruby3141 commented May 10, 2024

I think you want to give user a audible signal when hovered item is "changed to something(except nothing)",
like tingling menu sound of quake 3 or something.

In my opinion, you should either

  • Manually track value of ImGui::GetHoveredID() and play sound when it changes to non-zero value, or
  • Directly access to GImgui and check HoveredIdTimer is 0.0f when ImGui::IsAnyItemHovered() is true.

Unfortunately I'm using imgui-rs and both approach seem impossible here. I'm not sure they're valid.

@Iacaka
Copy link
Author

Iacaka commented May 10, 2024

@ruby3141 I will try and send feedback as soon as i can. Thanks for the suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants