Download

Setting the width of an SOverlay

Hey Everyone,

So I’ve got this Slate widget with an SOverlay in it and I wanted to align it to the top-right corner of the screen and give it a fixed width - say 200. Has anyone tried something like this?

In the end I just want a panel in the top-right corner of the screen, with some specified width and a SVerticalBox inside it.

Cheers!

/ Kyle


SNew(SOverlay)
+SOverlay::Slot()
.HAlign(HAlign_Right)
.VAlign(VAlign_Top)

    SNew(SBox)
    .WidthOverride(200)
    
         //your widgets here
    ]
]

SBox allows you to specify size of it by using Width/Height Override. Above code will add SOverlay Slot to the top right corner while overlay itself still will be covering whole viewport.

You can also do it other way around and put SOverlay into SBox depending on what exactly do you need.

Cool thanks, I’ll give that a shot.