[Solved] Button animation on hover/click (from XML/Lua)
Posted: Wed Oct 20, 2010 19:39
Hi
I have a short question and if the answer is positive I'll add all the details you might need to help me with the "how". But first the "if" ...
Well the title kinda says it all ;o) I have a Ogre/CEGUI/Lua app setup with all of the UI code banished to Lua with all of the layout in XML (so, no C/C++ code ever does anything with my GUI atm, except from the CEGUI call to load the main Lua file ofc ;o)
I managed to get basic animation working fairly quickly (got caught by not reading the manual properly, injected time pulse in ms instead of sec. Animation was over before I could see it ;o) and have a, fairly, nice fade in when the main menu loads. I also get how you bind animations to transitions like switching from main menu to the options sub menu. What I can't figure out, find in forums or even be sure is possible, is if you can get a transition animation from button state normal to hover (or hover to clicked, anyway ...)?
I tried naively putting some anim. definitions in the looknfeel XML (more hoping then believing) and that did not work. Is there a way?
I know I could probably hack around it by using static images under a static text and just do the blending on my own, but that is kinda defeating the point of having a button class ;o) So, is it built in somehow? In my world it's probably one of the more obvious things you'd wanna fade, but then again it's all relative.
(I'd really like to have this feature so if it's not there yet maybe we could work on it together? Would be cool if you could just define it in the looknfeel or layout as a property...)
Cheers for now!
I have a short question and if the answer is positive I'll add all the details you might need to help me with the "how". But first the "if" ...
Well the title kinda says it all ;o) I have a Ogre/CEGUI/Lua app setup with all of the UI code banished to Lua with all of the layout in XML (so, no C/C++ code ever does anything with my GUI atm, except from the CEGUI call to load the main Lua file ofc ;o)
I managed to get basic animation working fairly quickly (got caught by not reading the manual properly, injected time pulse in ms instead of sec. Animation was over before I could see it ;o) and have a, fairly, nice fade in when the main menu loads. I also get how you bind animations to transitions like switching from main menu to the options sub menu. What I can't figure out, find in forums or even be sure is possible, is if you can get a transition animation from button state normal to hover (or hover to clicked, anyway ...)?
I tried naively putting some anim. definitions in the looknfeel XML (more hoping then believing) and that did not work. Is there a way?
I know I could probably hack around it by using static images under a static text and just do the blending on my own, but that is kinda defeating the point of having a button class ;o) So, is it built in somehow? In my world it's probably one of the more obvious things you'd wanna fade, but then again it's all relative.
(I'd really like to have this feature so if it's not there yet maybe we could work on it together? Would be cool if you could just define it in the looknfeel or layout as a property...)
Cheers for now!