Generic animation support for CEGUI::Window
Posted: Mon Aug 02, 2010 13:12
I think it would be really nice to have some sort of animation capabilities in CEGUI::Window. Even though it's mostly just eye candy, in specific cases it aids usability by hinting the user where to look. Plus CEGUI is meant for games and multimedia applications and eye candy is tolerated in that kind of stuff.
I propose creating a class CEGUI::AnimationSet (or something). This class would contain CEGUI::Animation elements. CEGUI::Animation could just support keyframe based animation of properties or we could do it generically so that key frame animation is only one specialization class of CEGUI::Animation (not decided yet). Each animation would support looping, wrapping, or just "run once" and could be started, stopped, paused and unpaused at any time. Something like stepAnimations will be called every injected time pulse by CEGUI::Window and it would call CEGUI::Animation::step for each contained animation.
Then we could simply inherit CEGUI::Window from CEGUI::AnimationContainer and gain free animations.
Furthermore I would like to add support for that to .looknfeel files so that you could define animations including keyframes and then bind them to specific events via their string names. This way you could include skin specific animations to your .looknfeel file.
Example usage 1:
You click the close button of FrameWindow. This is bound to a method that will start the "Close" animation and bind handleCloseWindow() to "EventAnimationEnded" of the "Close" animation. The close animation could simply fade alpha or even shrink the FrameWindow by altering size or any combination of both. And when the animation ends it will fire EventAnimationEnded and the method that will really close/destroy the window gets called. Same thing for opening new frame windows.
Example usage 2:
The hovering state of buttons, checkboxes, etc could fade in and out instead of just switching instantly.
Example usage 3:
The FrameWindow rollup could be gradual.
Example usage 4:
With the new fancy rotation propery of every CEGUI::Window, Windows that don't have mouse over them could rotate sideways to take less space and when you place mouse over them, they would rotate back to you. Adding something like Zoom property could provide even more senseless eye-candy
[Example usage 5:
Switching tabs could quickly slide the tabs left and right until the desired one is there - this will probably be tricky...
This isn't priority number one for me, but I could work on it in my spare time once I get the layout containers working and upstream if there are enough people that would like it. I am asking for ideas (any specific use case you would like to work and it wouldn't with this implementation?) and endorsement
EDIT: AnimationSet instead of AnimationContainer.
I propose creating a class CEGUI::AnimationSet (or something). This class would contain CEGUI::Animation elements. CEGUI::Animation could just support keyframe based animation of properties or we could do it generically so that key frame animation is only one specialization class of CEGUI::Animation (not decided yet). Each animation would support looping, wrapping, or just "run once" and could be started, stopped, paused and unpaused at any time. Something like stepAnimations will be called every injected time pulse by CEGUI::Window and it would call CEGUI::Animation::step for each contained animation.
Then we could simply inherit CEGUI::Window from CEGUI::AnimationContainer and gain free animations.
Furthermore I would like to add support for that to .looknfeel files so that you could define animations including keyframes and then bind them to specific events via their string names. This way you could include skin specific animations to your .looknfeel file.
Example usage 1:
You click the close button of FrameWindow. This is bound to a method that will start the "Close" animation and bind handleCloseWindow() to "EventAnimationEnded" of the "Close" animation. The close animation could simply fade alpha or even shrink the FrameWindow by altering size or any combination of both. And when the animation ends it will fire EventAnimationEnded and the method that will really close/destroy the window gets called. Same thing for opening new frame windows.
Example usage 2:
The hovering state of buttons, checkboxes, etc could fade in and out instead of just switching instantly.
Example usage 3:
The FrameWindow rollup could be gradual.
Example usage 4:
With the new fancy rotation propery of every CEGUI::Window, Windows that don't have mouse over them could rotate sideways to take less space and when you place mouse over them, they would rotate back to you. Adding something like Zoom property could provide even more senseless eye-candy
[Example usage 5:
Switching tabs could quickly slide the tabs left and right until the desired one is there - this will probably be tricky...
This isn't priority number one for me, but I could work on it in my spare time once I get the layout containers working and upstream if there are enough people that would like it. I am asking for ideas (any specific use case you would like to work and it wouldn't with this implementation?) and endorsement
EDIT: AnimationSet instead of AnimationContainer.