NIFTY: Drag and Drop detection

How can I detect when I am dragging and dropping an object??

I have a method in the update loop that checks if the mouse cursor is in the top left corner, if it is I call showGUI() and show my menu and if its not I call hideGUI() and hide my menu. I also have a method in hideGui() that checks if any window is open and if so it returns and gets out of the hideGui() method. This works great except that if I click on title to drag the window now the window isn’t considered open (won’t get detected by >>> return dialogLayer.findElementByName(string) != null; <<< and the hideGui() will happen and the gui will disappear.

So what I need is a way to detect if the user is dragging the window so I won’t allow the hui to disappear when window is being dragged.

anyone knows how I can detect that?

bump :frowning:

Just looking through the nifty source code it looks like the window control is a based on the draggable control. When you click on a draggable object it moves it into the popup layer which is why your find element call won’t find it. I haven’t done it myself, but you can call some of the nifty popup methods to find your control probably (IE “getTopMostPopup” or “findPopupByName”). I’m not sure what the popid is for a draggable control so you will have to do some looking around. Hopefully this at least points you in the right direction.

1 Like