Is it true that this GUI EventType is only detected when the mousecursor hovers over the titlebar of the IGUIElement? Same goes for EGET_ELEMENT_LEFT.
If there is a way to change this to detection when the mousecursor is inside the rectangle of the element that would be nice I dont want my camera to rotate when the user has his mousecursor inside a window The way it is now, he has to hover over the titlebar first. It is possible that user enters the rectangle of the window from the bottom.
Am i trying to do this the correct way or am i being stupid as usual Is there any other approach on achieving what i want?
EGET_ELEMENT_HOVERED only on titlebar?
i second this request. it's because when i'm pressing a GUI element in my scene editor (dragging window/pressing button etc.) it automatically selected the scene node which is behind the element.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
now i can get EGET_ELEMENT_HOVERED to work but not EGET_ELEMENT_LEFT
in event receiver class,
cursorUnderGUI doesn't seem to change to false;
in event receiver class,
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));}
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
weird, it now works again just now i tried many times but it just didn't work i do't know why. my problem has solved, how about you, instinct?
EDIT: weird, sometimes it works but sometimes not. something wrong my code?
EDIT: weird, sometimes it works but sometimes not. something wrong my code?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
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?
if it works in the newest SVN i guess i'll have to wait untill there is a new release, the system administrator is having holiday lol.
Here's my code snippet
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
}
}
}
}
}
}