Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UGameViewportClient
Description
Adds a widget to the Slate viewport's overlay (i.e for in game UI or tools) at the specified Z-order. associates it with a specific player and keeps it in their sub-rect.
| Name | AddViewportWidgetForPlayer |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/GameViewportClient.h |
| Include Path | #include "Engine/GameViewportClient.h" |
| Source | /Engine/Source/Runtime/Engine/Private/GameViewportClient.cpp |
virtual void AddViewportWidgetForPlayer
(
ULocalPlayer * Player,
TSharedRef < SWidget > ViewportContent,
const int32 ZOrder
)
Parameters
| Name | Remarks |
|---|---|
| Player | The player to add the widget to. |
| ViewportContent | The widget to add. Must be valid. |
| ZOrder | The Z-order index for this widget. Larger values will cause the widget to appear on top of widgets with lower values. |