urho icon indicating copy to clipboard operation
urho copied to clipboard

UIElement and Text mouse hover problem

Open ghost opened this issue 5 years ago • 2 comments

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"); });
}
}

ghost avatar Apr 17 '19 18:04 ghost

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"); };
	}
}

barefists avatar Apr 17 '19 22:04 barefists

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.

ghost avatar Apr 18 '19 16:04 ghost