Wrong mouse coordinates when using 'Constrain Aspect Ratio' on active camera
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)
asked Sep 16 '15 at 08:16 AM in Bug Reports
After looking into your issue I believe that this is working as intended. The position is relative to the size of the viewport (starting from the upper left corner), not necessarily the active sections of the screen. The workaround suggested in your post (offsetting the return value to provide the value needed for the desired outcome) would be a viable workaround in most cases. I hope that this information helps.
Make it a great day
answered Sep 16 '15 at 03:37 PM
Rudy Q ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here