I can't exactly figure out how to get the mouse event data. I'm passing data from a Lua event to the C++ function. I can get the window data, but not the mouse data.
Notw: I'm using the "Clicked" which is set by a property in the XML layout file.
LUA:
Code: Select all
function cmdIngameBuild_click(args)
....
guiman:BuildItemClick(args)
....
end
Declaration BuildItemClick:
Code: Select all
void BuildItemClick(const CEGUI::EventArgs& args);
Casting code:
Code: Select all
//Proper conversions:
CEGUI::MouseEventArgs argMouse = static_cast<const CEGUI::MouseEventArgs&>(args);
CEGUI::WindowEventArgs argWindow = static_cast<const CEGUI::WindowEventArgs&>(args);
CEGUI::PushButton* btn = static_cast<CEGUI::PushButton*>(argWindow.window);
The last two ones work. The MouseEventArgs are not initialized at all and contain a lot of junk data. I've searched the entire CEGUI solution collection, but no luck in finding an example.
Any idea?
---
hm, I just realized that this is the incorrect forum. Hm, oh well