I need to resize the main viewport in the game and put HUD stuff around it rather than over it. Google didn’t turn up much but I’m thinking it would be done with FViewportFrame::ResizeFrame? Does anyone have an example of how and where to implement this?
Basically like this:
So if this image was split up between three monitors, the middle monitor (main screen) would show the launchpad and the HUD below it, and the left and right monitors would be for configurations and displaying data. Or if the user only had one monitor, they could just switch between the 3 screens. The middle part is what I’m trying to figure out right now though, how to resize the display so that I can put the HUD underneath it. There also needs to be a way for the user to toggle between the resized viewport or to maximize it.
One way to do it is using RenderToTarget texture and add a Image in your UI to display it. From a performance perspective, it’s not the best but it will work
In fact the GameViewport include the UI, so if you are modifing it, you are impacting your UI size also.
You might have a look at “multiple” Viewport (like multiplayer game on 1 device) and see if you can use this have 1 viewport drawing the UI and the other one the main image.
Is there anyway to easily change the projection matrix/view port for 3D scene, and render 2D HUD on the side like the pic shown above?
It was basically explained above: use a render target. If you’re not re-rendering the scene behind the UI again then it should be faster than a full-screen pass would have been.
Of course you’d have to be clipping off a LOT of the viewport to justify it. If it doesn’t look like the sample above I wouldn’t bother with it at all and I’d just draw the HUD over the viewport.
Cool UI btw.
In case you don’t want to use render targets, there is a plugin for that now.
Answered here:
The plugin docs: