In a Widget
you have the option to override the functions On Mouse
like On Mouse Enter/Leave
which are useful if you are doing something with that Widget
as a whole, but it is way too general if you want to do something with elements inside it separately that you need the same On Mouse X
function.
The problem that I have is that I don’t see a way to bind/call a function to do the same thing like you can for the Widget, but for each element in particularly. I only see two ways to achieve this:
- To create
On Tick
event, and inside it to check with a bool branchHas Mouse Captured
for each element that you are interested in doing something when the mouse is over that element for example, but this is a bit tedious if you have quite a few elements you want to do this for, and also it doesn’t give the same control like with the overrides you have for a widget; - To create a new widget with each element you want to do something
On Mouse
events, and add/create that Widget inside the “Main widget”. This will give you the same control as you have with a widget as the elements themself are now widgets and not simple overlays, or images, or… This will also require more work then just having an option for anOverlay
for example to bind/set on mouse X event.
That being said, did I missed something and what I want can be achieved simply by calling a bind/function for each element, or I really need to do it one of the two ways I mentioned above?