I have a button in an editor window, and when I click the button, I’d like to open a new editor window on top of that at the position of the button I clicked on. As far as I know the Event.current.mousePosition gives me the mouse position relative to the editor window I’m in and also relative to the guilayout. So, similar to GetLastRect, if I’m inside of a beginhorizontal or two, then the mouse position isn’t even going to be relative to my current editor window.
My question is, how can I either get the mouse position or the button position in absolute coordinates ( not relative to the guilayout ) so that I can open the editor window at the location of the button I clicked.
If neither of these questions have answers, does anyone have any ideas for me to accomplish this problem a different way? Maybe finding the location of the button or mouse cursor isn’t the way to solve this.
Please note that this is in the editor, needs to be able to run on mac and windows, and must work on multi monitor displays.
Perhaps there's a way to find the mouse position in .Net that doesn't rely on the System.Windows dll?
– Clementclementas