About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
Gui.objAtPos never return null
Author Message
Lancer Offline
Member

Post: #1
Gui.objAtPos never return null
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
(This post was last modified: 10-18-2020 05:22 PM by Lancer.)
10-18-2020 05:06 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Gui.objAtPos never return null
Yes looks good
10-19-2020 02:39 AM
Find all posts by this user Quote this message in a reply
Post Reply