1. Create a function to set the UI scale in UE4.
2. Find the display size of UI mapping in the obtained cached geometry.
3. Then get the original size of the UI map in Get Desired Size, so that the scaling ratio of the UI map can be calculated.
4. Map Ratio UIScale (UI scale can be multiplied to get the final scaling ratio, and we can scale the map by adjustment.
Scaling offset of UMG scene window size in UE4
1. You can use the project world to filter the nodes in UE4. Only when the window is full-screen, UMG can accurately track the actors, otherwise it will be offset.
2. At this time, we can see that any zoom window size can accurately track the 2D coordinates of the screen.
The specific calculation formula is: divide the current screen 2D coordinate by the zoom ratio of the window to get the correct screen 2D coordinate.