Page 1 of 1

[Solved]mouse cursor in window

Posted: Thu Jul 17, 2008 09:40
by K0h4n
i create a window 1/4 of the root width and height
and i put it at the bottom left side

is there any input reader so when the mouse is on top of the window, the alpha of the window is 1 and set the window active
when the mouse is outside the window the alpha will be 0.5 and deactive the window

i'm using default window
changing alpha is easy but i still cannot figure how to check whether the mouse cursor is inside the window or outside the window

any help is appreciated

Posted: Thu Jul 17, 2008 11:10
by CrazyEddie
You could subscribe the Window::EventMouseEnters / Window::EventMouseLeaves for the Window and respond to those.

Alternatively, you could check the System::getWindowContainingMouse return result periodically, be aware there is a minor known issue with this member function: http://www.cegui.org.uk/mantis/view.php?id=213

HTH

CE.

Posted: Thu Jul 17, 2008 15:11
by K0h4n
wow it works
thank you Eddie