// Create a slot container TSharedPtrVerticalBox = MakeShareable(new SVerticalBox()); // Add a new slot to the container VerticalBox->AddSlot() .AutoHeight() .HAlign(HAlign_Center) .VAlign(VAlign_Center) [ SNew(STextBlock) .Text(FText::FromString("Hello World!")) ];
// Create a slot container TSharedPtrThis example creates an overlay container and adds a new slot to it. The slot is set to be centered horizontally and vertically. It contains an image widget with a checkmark icon from the editor style. Package library: Unreal EngineOverlay = MakeShareable(new SOverlay()); // Add a new slot to the container Overlay->AddSlot() .HAlign(HAlign_Center) .VAlign(VAlign_Center) [ SNew(SImage) .Image(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Sprites.Checkmark").GetSmallIcon()) ];