Temporarily highlighting label changes in egui #7339
-
Hello, I'm reaching out because I have a question about the label widget. Is there a recommended way to briefly highlight a label (for example, by changing its text or background color for a few seconds) when its text changes? Is this possible with egui? Thank you very much for your time and help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I assume you store the label's string value in a variable. You could perhaps check if that buffer has been changed. As for the briefly highlighting, you can use this function to get an animated value. |
Beta Was this translation helpful? Give feedback.
I assume you store the label's string value in a variable. You could perhaps check if that buffer has been changed. As for the briefly highlighting, you can use this function to get an animated value.
You could use this float to multiply a channel of color in your label wherever you want to. Like you could animate the white text to flash red or whatever. Also keep in bind that this float goes from 1 to 0 or from 0 to 1 and every value in between, but thats written in the documentation I think.
The ID must be unique as this is how egui finds which animation to increment.
I hope I could help you! If you found this solved your issue please mark this as the answer, thanks!