If there is a way to change this to detection when the mousecursor is inside the rectangle of the element that would be nice
![Smile :)](./images/smilies/icon_smile.gif)
![Wink ;)](./images/smilies/icon_wink.gif)
Am i trying to do this the correct way or am i being stupid as usual
![Razz :P](./images/smilies/icon_razz.gif)
Code: Select all
case EGET_ELEMENT_HOVERED:
{
cursorUnderGUI = true;
}
break;
case EGET_ELEMENT_LEFT:
{
cursorUnderGUI = false;
}
Code: Select all
if (smgr->getActiveCamera() == camera && cursorUnderGUI == false)
{
selectedNode = smgr->getSceneCollisionManager()->getSceneNodeFromScreenCoordinatesBB(vector2d<s32>(x, y));}
I dont have acces to the SVN, since my development environment can't connect to the internet, i have to use internet on another environment... >_<bitplane wrote:Works for me in SVN. Can you show an example using minimal code?
Do you have another GUI element inside the window, and this gets the hover event instead?
Code: Select all
switch( e.EventType )
{
case EET_GUI_EVENT:
{
switch( e.GUIEvent.EventType )
{
case EGET_ELEMENT_HOVERED:
{
if( pCaller->getType() == EGUIET_WINDOW )
{
core::rect<s32> WindowBox = pCaller->getAbsolutePosition();
core::position3d<s32> MousePos = m_pDevice->getCursorControl->getPosition();
if( WindowBox.isPointInside(MousePos) )
{
m_bHovered = true; //hover event boolean
}
}
}
case EGET_ELEMENT_LEFT:
{
if( pCaller->getType() == EGUIET_WINDOW )
{
core::rect<s32> WindowBox = pCaller->getAbsolutePosition();
core::position3d<s32> MousePos = m_pDevice->getCursorControl->getPosition();
if( !WindowBox.isPointInside(MousePos) )
{
m_bHovered = false; //hover event boolean
}
}
}
}
}
}