Page 1 of 1

Hovering a GUI Image. *Solved

Posted: Sat Jul 29, 2006 3:44 am
by Dirtbiker
I am making GUI menu using GUI Images. I need to show text when an image is hovered. My problem is when I check if the GUI Image element ID is Hovered I get no response. I'm sure I have the correct ID.
Can a GUI Image be checked for hovering?
Thank you.

Image

Posted: Sat Jul 29, 2006 5:01 am
by vitek
How are you checking that the image is hovered? As far as I see, there is no way to check that a gui control is hovered. An event is generated, and you have to respond to the event that is passed to the user event receiver.

Travis

Posted: Sat Jul 29, 2006 8:51 am
by Dances
I would personally just get the cursors position and compare it with the button's co-ords...

Posted: Sat Jul 29, 2006 3:49 pm
by vitek
So you did something like this...

Code: Select all

const core::position2d<s32> mouse = //...
if (image.getAbsoluteRect().isPointInside(mouse))
{
  // do something
}
That should work to detect mousing over an image. The environment manager is already tracking the element that the mouse is over. If you receive messages with an event receiver, you can respond to the hover event.

Travis

Posted: Sun Jul 30, 2006 9:08 pm
by Dirtbiker
Thank you vitek and Dances. I just realized I was drawing the debug text before the scene. I am recieving Hovered event.