-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Window Hovering fading animation #1925
Comments
Hi, I'm not a Lua expert but should
be
without brackets ? |
HoverAction is the function but we want the return value HoverAction() |
ok, so in Lua you can call a local function declared inside a local function! |
local just means not global scope |
FYI, I implemented something like you described. Just in case someone is interested. |
I forgot : I have added "heartbeat effect" too (e.g.for buttons). It was a must in Mac OS X at the beginning :-) |
Animated GIF would be nice to see what you've done. |
Ok, this gif is far better than the previous one. Most of the issues are imho fixed, and it works very well. I did all the tests in the SDL2 OpenGL3 example (Linux x86_64 / gcc g++)
in main : init
In the main loop:
Second window ("Another window, with heartbeat effect):
One little issue : when both windows are superposed, the cursor is seen as hovering an hidden window. Could probably be solved using the focused window, and so on). Edit : the child window issus is fixed. Seems to work as expected now. |
I forgot : the links for the files (.cpp and .hpp) didn't change, see above. |
@ebachard I used your class to create an animation with a window. Just an experiment. Somewhere in main.cpp file
in the loop
Screencast_20241230_204446.mp4 |
But before I found your implementation, I played with my own (about 10 minutes and then I went searching the internet). Just a 'drawing', maybe it will be useful to someone..
Usage: Somewhere in main.cpp
In main loop:
Screencast_20241230_205516-1.mp4 |
You have a few errors there. 1)
It has to be like this:
This prevents unexpected behavior. 2)
But you need to define it in the class definition like this:
This allows you to have multiple instances of the animator at the same time. |
It has been commented several times.
Here is a proof of concept that it can be done without any ImGui modification
This Lua code could be done with a class in C++ or a lambda function and provide us a function that when called from the window to be hovered returns a value in animated variation between two values
To use it just use the HoverActionFactory as in
And after ImGui::Begin
The text was updated successfully, but these errors were encountered: