Over Noesis GUI
Posted: 19 Apr 2015, 05:19
I am attempting to figure out an easy way to tell if the mouse is currently over any noesis gui element.
The reason for this is because I have an RTS style game with a selection box, I want to draw the selection box if I am not over a control, if i am over a control I want the control behavior to work.
Is there any easy way to tell when the mouse is clicked if it was clicked over a control or not?
The basic layout I have is a grid control with the background set to transparent. There are controls on the bottom and top. If the mouse is over one of these controls then I would not want the game event to occur and instead would like the gui event to occur.
I have a few poor workarounds atm such as whenever the mouse is clicked I iterate over the entire control hiearchy and check each control bounds to see if he mouse is over it. It seems to work but seems horribly inefficient.
The reason for this is because I have an RTS style game with a selection box, I want to draw the selection box if I am not over a control, if i am over a control I want the control behavior to work.
Is there any easy way to tell when the mouse is clicked if it was clicked over a control or not?
The basic layout I have is a grid control with the background set to transparent. There are controls on the bottom and top. If the mouse is over one of these controls then I would not want the game event to occur and instead would like the gui event to occur.
I have a few poor workarounds atm such as whenever the mouse is clicked I iterate over the entire control hiearchy and check each control bounds to see if he mouse is over it. It seems to work but seems horribly inefficient.