I’d like to be able to specify a region of the screen to use as the drawable area. I currently have a scene in game and a UMG widget I can toggle on and off acting as a sidebar.
When the sidebar is visible, I’d like to resize the render region to compensate for the screen space the sidebar occupies to keep the scene centered in the visible area.
Attempted Solutions
I’ve tried to offset the camera to “re-center” the scene to compensate for the sidebar, but manipulating the perspective camera makes interaction feel more incorrect than having a portion hidden, since the user expects the camera to be capturing from the center of the visible area.
I’ve tried capturing the scene using a scene capture camera, but faking the view that way makes input a pain. Additionally, I feel fairly confident that the correct solution doesn’t involve rendering the whole scene twice then obscuring one of those scenes with a fixed-resolution render of said obscured scene.
I’ve looked into doing something silly with splitscreen layouts, but realized that it was silly and there is probably a more correct way to achieve this.
Here’s what’s currently happening when I display the sidebar. Notice how the snowmobile is technically centered on the screen, but is effectively partially offscreen, hidden behind the sidebar widget.
Here’s an example of what I’d like the scene to look like when I display the sidebar. Notice how the scene is centered in the area not occupied by the sidebar. The game knows it can only render to a specific region, so the camera compensates for it (similar to changing screen resolution).
Finally, here’s what I assume it would look like with the render region resized without displaying the sidebar. This image is to show that I’m not wanting to shift the camera, but instead to render the exact same scene on only a portion of the screen.
Unfortunately, I wasn’t able to find any way to change the render size and position on the screen. My solution involved using the screen size, distance from the camera and field of view to manually offset the camera to meet my needs.
Viewport widget in UMG or Slate, never used it yet so you need to test out it works, use Slate if you need to it gives more options and as i remeber they added viewport widget as experimental in UMG. This might take some proformance or else you manipulate main viewport settings which probably requires C++
Use Post Processing material, make centered UV map (it should take simple math) only to portion of the screen and make text aperr on empty space
Moving camera is also good option it does not matter how you do it as long it is not resource heavy and slick, the final effect is most importent
In Unity3D, such things are very easy to do through clipping planes and viewport rect.
I’m surprised that unreal can’t handle such simple things. And apparently this will not be possible at all because of the more primitive architecture of the engine than Unity3D.
Hi, i had a need to do this for some of my apps.
I added the solution as part of a plugin called EnhancedUi. Which is mainly tools to build “Editor Like” UI/Ux at runtime.