Closed Nielsbishere closed 4 years ago
Don't have time to analyze your code (hopefully someone else will), but there are several things in Nuklear to consider when having this issue (the following is not exhaustive).
It was partially because of my implementation. But it worked after I got rid off NK_KEYSTATE_BASED_INPUT and sent it to nk through callbacks, so perhaps that is an issue?
I remember some issues with the two input "modes" (one reacting on rising edge and the other on the falling edge). You have to use the correct one for your chosen backend. And of course, there might still be some bugs. Feel free to read all demo/
s to get a glimpse how to approach that.
Now I noticed what you were talking about; clicking through a tooltip or checkbox. It should consume it instead of keep checking if the mouse is in the area
Yep, that was the effect of incorrect usage of
/// NK_KEYSTATE_BASED_INPUT | Define this if your backend uses key state for each frame rather than key press/release events
and also maybe some bug(s).
I don't use that anymore
It's because mouse events aren't consumed or because the order of when a click is used is wrong. This means that if you have two elements on top of each other, it should only be consumed for the top.
That sounds to me like the known problem with overlapping widgets/windows (especially popups and menus). Everything overlapping doesn't have first class support in Nuklear and is 1 frame late thus making place for weird states and bugs. This is not easily solvable in an elegant way (there is actually a way - see https://github.com/Immediate-Mode-UI/Quarks ).
Could this be the reason for the poor experience you're describing?
Yes, it is fixed in https://github.com/Immediate-Mode-UI/Nuklear/pull/14
My guess is that point->box checks are broken, but it can also obviously also be my code. The following work fine: sliders, progress bars. Trying to use anything else however, won't work correctly. Other things such as radio, push buttons, sliders and checkboxes don't work. Sliders however do work sometimes, but barely. https://imgur.com/a/VQYFFRs The code can be found at on my repo but can only be built on Windows with CMake.
NK code
Render code (after nk code)
Input events