There is an issue with the engine reporting current mouse coordinates. When constrain is not used, everything is fine no matter what aspect ratio is used, windowed or fullscreen. Unfortunately when I use the constrain, the mouse coordinates are still from the top-left corner of the window / screen, not the render area which messes up calculations. I would need to figure out the offset and then modify the calculations. I believe that’s not the way it should work.
I made a test project without any modifications I normally have and the problem still exists. The project uses blueprint, but the same problem can be seen when the logic is placed in C++.
From my understanding, the absolute mouse position on screen does not take into account the black bars at all, they are completely ignored. Therefore if you have black bars on the left and right of the screen, the horizontal coordinate is corrupted. What I mean is, if both bars are 200 px wide and the render area is 600, that gives total 1000px. But 0,0 is not at the render corner, but rather at the black bar corner. Which is an area nobody is going to use, that’s what the black bars are for. I’d want the 0,0 coordinate be at where 300,0 is in my current situation, which is the first pixel in top left corner.
Screenshot of what I mean:
The issue appears in both editor and non-editor builds.
Open map ‘screencoord’ and hit play. The blueprint will print current coordinates. You can notice where the cursor is by hovering outside of the editor window (I wanted to add something that would render at the cursor location, but all my attempts failed)[ ][2]