urho
urho copied to clipboard
UIElement and Text mouse hover problem
Hi, i can't run HoverBegin, HoverEnd delegates. How can i use control events. I added to elements to UI.Root and their see. But my mouse event don't invoke...
For example:
public class UIElementFoo : UIElement {
public UIElementFoo() {
/*My child elements*/
HoverBegin += new Action<HoverBeginEventArgs>((e) => { Console.WriteLine("Hover begin"); });
HoverEnd += new Action<HoverEndEventArgs>((e) => { Console.WriteLine("Hover end"); });
}
}
Works if I write this
public class UIElementFoo : UIElement {
public UIElementFoo() {
/*My child elements*/
HoverBegin += (HoverBeginEventArgs) => { Console.WriteLine("Hover begin"); };
HoverEnd += (HoverEndEventArgs) => { Console.WriteLine("Hover end"); };
}
}
I think events work directly added child to UI.Root elements.
UI.Root -Window A (Work) --Window A Childs (Not work) -Window B (Work) --Window B Childs (Not work)
My UI Structure:
public class WindowA : Window {
public WindowA()
{
AddChild(ElementA());
AddChild(ElementB());
}
}
UI.Root.AddChild(WindowA); Event just run with WindowA. Bu Childs doesn't invoke.