is there a way to get the top left corner (in pixels) of the running game on the physical screen? In Fullscreen mode its just (0,0). But how can I get it if it runs in windowed mode? I don’t mean the application window frame but the rendered image of the game. And how can I get it when I run it in the editor? (would be the top left pixel of the rendered image in the game-tab then)
ScreenToWorldPoint Transforms a point from screen space into world space, where world space is defined as the coordinate system at the very top of your game’s hierarchy.
ViewportPointToRay Returns a ray going from camera through a viewport point.
I’ve looked at these but I think ScreenPoint there means within the player’s application window. But I need it on system / OS level if one could say so. I’ve attached an image to explain what I mean. It shows the editor but would be the same problem with a windowed player. Everything I can access in Unity is relative to the yellow rectangle. What I need would be some sort of ScreenPointToSystemPoint((0,0)) - returning (599,582) for the example in the attached image.
You can gram mouse pointer position, if outside the application.
But not don’t know, if Unity has option, to grab application position itself.
This may be required for OS specific.
I don’t believe Unity has any utilities for knowing the application’s true on screen position. All “screen” representations within Unity’s c# interface is a position relative to the current window, not the actual display.
On Windows there are some utilities for setting the window position though.