Hi All,
today I run across a strange behavior in UE and was just wondering if this working as designed or if it’s a bug.
I need to draw a UI widget when the game starts, and I need it to be in the middle of the screen. So I was simply calculating ((viewport-size/2)-(desired-size/2))/viewport-scale. So with my test resolution of 1280x720 I was expecting X to be 640 but it always was 615, which was frustrating. With larger resolution the difference was even bigger.
So I played a bit around and found out that when the position set during “event construct” it’s having this incorrect position but when I set the widget position after it was constructed, through event-tick, it’s positioned correctly.
Why is there a different behavior depending on where you set the position and where is the correct place to set the widget position?
Thanks in advance!
Best regards,