Navigation
API > API/Runtime > API/Runtime/SlateCore
Implements an overlay widget.
Overlay widgets allow for layering several widgets on top of each other. Each slot of an overlay represents a layer that can contain one widget. The slots will be rendered on top of each other in the order they are declared in code.
Usage: SNew(SOverlay)
- SOverlay::Slot(SNew(SMyWidget1))
- SOverlay::Slot(SNew(SMyWidget2))
- SOverlay::Slot(SNew(SMyWidget3))
Note that SWidget3 will be drawn on top of SWidget2 and SWidget1.
| Name | SOverlay |
| Type | class |
| Header File | /Engine/Source/Runtime/SlateCore/Public/Widgets/SOverlay.h |
| Include Path | #include "Widgets/SOverlay.h" |
Syntax
class SOverlay : public SPanel
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SPanel → SOverlay
- FSlateControlledConstruction → SWidget → SPanel → SOverlay
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SOverlay() |
Widgets/SOverlay.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~SOverlay() |
Widgets/SOverlay.h |
Classes
| Name | Remarks |
|---|---|
| FOverlaySlot | A slot that support alignment of content and padding and z-order |
Structs
| Name | Remarks |
|---|---|
| FArguments |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FScopedWidgetSlotArguments | TPanelChildren< FOverlaySlot >::FScopedWidgetSlotArguments | Widgets/SOverlay.h | |
| PrivateParentType | SPanel | Widgets/SOverlay.h | |
| PrivateThisType | SOverlay | Widgets/SOverlay.h | |
| Super | SPanel | Widgets/SOverlay.h | |
| ThisClass | SOverlay | Widgets/SOverlay.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FScopedWidgetSlotArguments AddSlot
(
int32 ZOrder |
Adds a slot at the specified location (ignores Z-order) | Widgets/SOverlay.h | |
void ClearChildren() |
Removes all children from the overlay | Widgets/SOverlay.h | |
void Construct
(
const FArguments& InArgs |
Construct this widget. | Widgets/SOverlay.h | |
int32 GetNumWidgets() |
Returns the number of child widgets | Widgets/SOverlay.h | |
bool HasSlotWithZOrder
(
int32 ZOrder |
Returns true if there is a child slot with the specified z-order | Widgets/SOverlay.h | |
bool RemoveSlot
(
TSharedRef< SWidget > Widget |
Removes a widget from this overlay. | Widgets/SOverlay.h | |
void RemoveSlot
(
int32 ZOrder |
Removes a slot at the specified location | Widgets/SOverlay.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FChildren * GetChildren () |
All widgets must provide a way to access their children in a layout-agnostic way. | Widgets/SOverlay.h | |
virtual void OnArrangeChildren
(
const FGeometry& AllottedGeometry, |
Panels arrange their children in a space described by the AllottedGeometry parameter. | Widgets/SOverlay.h | |
virtual int32 OnPaint
(
const FPaintArgs& Args, |
The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children. | Widgets/SOverlay.h |
Overridden from FSlateControlledConstruction
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FSlateWidgetClassData & GetWidgetClass() |
Widgets/SOverlay.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 GetChildIndexByZOrder
(
int32 ZOrder |
Returns the index of the child slot at the specified z-order | Widgets/SOverlay.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FVector2D ComputeDesiredSize
(
float |
A Panel's desired size in the space required to arrange of its children on the screen while respecting all of the children's desired sizes and any layout-related options specified by the user. | Widgets/SOverlay.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static const FSlateWidgetClassData & GetPrivateWidgetClass() |
Widgets/SOverlay.h | ||
static void PrivateRegisterAttributes
(
FSlateAttributeInitializer& |
Widgets/SOverlay.h | ||
static FOverlaySlot::FSlotArguments Slot
(
int32 ZOrder |
Widgets/SOverlay.h | ||
static const FSlateWidgetClassData & StaticWidgetClass() |
Widgets/SOverlay.h |