Navigation
API > API/Runtime > API/Runtime/UMG
The Safe-Zone widget is an essential part of developing a game UI that can run on lots of different non-PC platforms. While a modern flat panel computer monitor may not have over scan issues, this is a common occurrence for Consoles. It's common for TVs to have extra pixels under the bezel, in addition to projectors and projection TVs having potentially several vertical and horizontal columns of pixels hidden behind or against a black border of the projection screen.
Useful testing console commands to help, simulate the safe zone on PC, r.DebugSafeZone.TitleRatio 0.96 r.DebugActionZone.ActionRatio 0.96
To enable a border to visualize the safe zone, use this console command, r.DebugSafeZone.Mode controls the debug visualization overlay (0..1, default 0). 0: Do not display the safe zone overlay. 1: Display the overlay for the title safe zone.
| Name | USafeZone |
| Type | class |
| Header File | /Engine/Source/Runtime/UMG/Public/Components/SafeZone.h |
| Include Path | #include "Components/SafeZone.h" |
Syntax
UCLASS (MinimalAPI)
class USafeZone : public UContentWidget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UVisual → UWidget → UPanelWidget → UContentWidget → USafeZone
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
USafeZone() |
Components/SafeZone.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| PadBottom | bool | If this safe zone should pad for the bottom side of the screen's safe zone | Components/SafeZone.h |
|
| PadLeft | bool | If this safe zone should pad for the left side of the screen's safe zone | Components/SafeZone.h |
|
| PadRight | bool | If this safe zone should pad for the right side of the screen's safe zone | Components/SafeZone.h |
|
| PadTop | bool | If this safe zone should pad for the top side of the screen's safe zone | Components/SafeZone.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void SetSidesToPad
(
bool InPadLeft, |
Components/SafeZone.h |
|
|
void UpdateWidgetProperties() |
Components/SafeZone.h |
Overridden from UPanelWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual UClass * GetSlotClass() |
UPanelWidget. | Components/SafeZone.h | |
virtual void OnSlotAdded
(
UPanelSlot* Slot |
Components/SafeZone.h | ||
virtual void OnSlotRemoved
(
UPanelSlot* Slot |
Components/SafeZone.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FText GetPaletteCategory() |
Gets the palette category of the widget | Components/SafeZone.h | |
virtual void OnDesignerChanged
(
const FDesignerChangedEventArgs& EventArgs |
Components/SafeZone.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool GetPadBottom() |
Components/SafeZone.h | ||
bool GetPadLeft() |
Components/SafeZone.h | ||
bool GetPadRight() |
Components/SafeZone.h | ||
bool GetPadTop() |
Components/SafeZone.h | ||
void SetPadBottom
(
bool InPadBottom |
Components/SafeZone.h | ||
void SetPadLeft
(
bool InPadLeft |
Components/SafeZone.h | ||
void SetPadRight
(
bool InPadRight |
Components/SafeZone.h | ||
void SetPadTop
(
bool InPadTop |
Components/SafeZone.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< SWidget > RebuildWidget() |
Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed. | Components/SafeZone.h |
Overridden from UVisual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ReleaseSlateResources
(
bool bReleaseChildren |
Components/SafeZone.h |