Setting StaticImage Clicked Handler in XML
Posted: Mon Sep 14, 2009 19:09
Hi,
I'm currently trying to create a splash page that will advance to the main screen when clicked. I currently have a static image with 2 children, a static text and a button (don't want the button). In the code I was able to use splashimage->subscribeEvent( CEGUI::Window::EventMouseClick, &HandlerFunction) to make the splash go away on a click, but I want to subscribe that in the layout xml instead of the code. I have a lua function that hides the splash and brings up the main page. I tried using <Event Name="Clicked" Function="Splash_Clicked" /> (Splash_Clicked is the Lua function) in the splash image's definition in the layout, but nothing happens when I click on the screen. If I use that same xml line in the definition of the button, clicking the button will call the function.
The static image can obviously do something on a clicked event, because it works in the code. Does this have to do with how the xml is parsed?
Thanks,
Nick
I'm currently trying to create a splash page that will advance to the main screen when clicked. I currently have a static image with 2 children, a static text and a button (don't want the button). In the code I was able to use splashimage->subscribeEvent( CEGUI::Window::EventMouseClick, &HandlerFunction) to make the splash go away on a click, but I want to subscribe that in the layout xml instead of the code. I have a lua function that hides the splash and brings up the main page. I tried using <Event Name="Clicked" Function="Splash_Clicked" /> (Splash_Clicked is the Lua function) in the splash image's definition in the layout, but nothing happens when I click on the screen. If I use that same xml line in the definition of the button, clicking the button will call the function.
The static image can obviously do something on a clicked event, because it works in the code. Does this have to do with how the xml is parsed?
Thanks,
Nick