You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Patch should be applied in
"maratis\branches\Experimental\Sources\MSDK\MGui"
** explanation of the patch
This patch allows selecting (highlighting) windows, with the following features:
* selecting a window will bring it to front
* clicking where there's no windows will unselect all windows
* windows can overlap with no side effects
* you can query if there are selected windows
* you can query if the mouse is over some window
* you have two modes for selecting windows:
rootWindow->setHardSelecting(true);
you have to click on a window to select it
rootWindow->setHardSelecting(false);
just hovering the mouse on a window will select it
In the case that the user is operating on a MGuiWindow, you may decide not to
send the input to the Maratis engine too (e.g. for clicking on 3D objects).
In other words you may want a GUI window to block a click or a key which
otherwise will be sent to the engine.
So you can also do "W,A,S,D movement" and still type those letters in a
MGuiEditText.
Here's an example on how to use the patch for what concerns input:
if(input->onKeyDown("MOUSE_BUTTON1"))
{ if(guiWinRoot->isMouseOverSomething())
guiWinRoot->onMouseButtonDown(MMOUSE_BUTTON_LEFT);
else
{ guiWinRoot->unHighLightAllWindows();
pick_3d_objects_with_raycasting();
}
}
else if(input->onKeyUp("MOUSE_BUTTON1"))
{ if(guiWinRoot->isSomethingHighlighted())
guiWinRoot->onMouseButtonUp(MMOUSE_BUTTON_LEFT);
}
if(guiWinRoot->isMouseOverSomething())
{ //send characters and keys to MGui
}
if(guiWinRoot->isSomethingHighlighted())
return;
//because of the previous lines and the "return", the following input won't work if there's a selected MGUI window
if(input->onKeyDown("ENTER"))
{ //do stuff
}
else if(input->onKeyDown("SPACE"))
{ //do stuff
}
//etc
Original issue reported on code.google.com by [email protected] on 16 Nov 2013 at 5:59
Original issue reported on code.google.com by
[email protected]
on 16 Nov 2013 at 5:59Attachments:
The text was updated successfully, but these errors were encountered: