Hi,
is it normal that Gui.objAtPos never returns null?
Im trying to make a check if player clicks on world and not on any UI. So I wanted to check wether ui is clicked or not with this code:
Code:
if (EE::Ms.bp(0))
{
if(EE::Gui.objAtPos(EE::Ms.pos()) == null)
{
LogN("No ui pressed");
}
}
but objAtPos never returns null. I tried printing the size of the return, and it's always the game screen size.
If I delete that object, then my whole UI gets removed.
So, is that normal that Gui.objAtPos never return null?
How do I check if player clicks on world and did not click on any UI.
Edit: Im calling the function within "Window::update(C EE::GuiPC& gpc)"
Edit2: Same with EE::Gui.msLit(). This function never returns null.
Edit3:
I made my code now like this
Code:
GuiObj* pGuiObj = EE::Gui.msLit();
if (pGuiObj == null || pGuiObj->type() == EE::GO_DESKTOP)
{
LogN("No UI pressed");
}
and I hope this will be fine