Navigation
API > API/Runtime > API/Runtime/Slate
Allows you to place content with a desired size and have it scale to meet the constraints placed on this box's alloted area. If you needed to have a background image scale to fill an area but not become distorted with different aspect ratios, or if you need to auto fit some text to an area, this is the control for you.
| Name | SScaleBox |
| Type | class |
| Header File | /Engine/Source/Runtime/Slate/Public/Widgets/Layout/SScaleBox.h |
| Include Path | #include "Widgets/Layout/SScaleBox.h" |
Syntax
class SScaleBox : public SCompoundWidget
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SCompoundWidget → SScaleBox
- FSlateControlledConstruction → SWidget → SCompoundWidget → SScaleBox
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SScaleBox() |
Constructor | Widgets/Layout/SScaleBox.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~SScaleBox() |
Widgets/Layout/SScaleBox.h |
Structs
| Name | Remarks |
|---|---|
| FArguments |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| PrivateParentType | SCompoundWidget | Widgets/Layout/SScaleBox.h | |
| PrivateThisType | SScaleBox | Widgets/Layout/SScaleBox.h | |
| Super | SCompoundWidget | Widgets/Layout/SScaleBox.h | |
| ThisClass | SScaleBox | Widgets/Layout/SScaleBox.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ComputedContentScale | TOptional< float > | Widgets/Layout/SScaleBox.h | ||
| IgnoreInheritedScaleAttribute | TSlateAttribute< bool > | Optional bool to ignore the inherited scale | Widgets/Layout/SScaleBox.h | |
| LastAllocatedArea | TOptional< FVector2D > | Widgets/Layout/SScaleBox.h | ||
| LastFinalOffset | FVector2D | Widgets/Layout/SScaleBox.h | ||
| LastPaintGeometry | TOptional< FGeometry > | Widgets/Layout/SScaleBox.h | ||
| LastSlotWidgetDesiredSize | FVector2D | Widgets/Layout/SScaleBox.h | ||
| NormalizedContentDesiredSize | TOptional< FVector2D > | Widgets/Layout/SScaleBox.h | ||
| OnSafeFrameChangedHandle | FDelegateHandle | Delegate handle to unhook the safe frame changed. | Widgets/Layout/SScaleBox.h | |
| OverrideScreenSize | TOptional< FVector2D > | Widgets/Layout/SScaleBox.h | ||
| SafeZoneScale | float | Computed scale when scaled by safe zone padding | Widgets/Layout/SScaleBox.h | |
| StretchAttribute | TSlateAttribute< EStretch::Type > | The method of scaling that is applied to the content. | Widgets/Layout/SScaleBox.h | |
| StretchDirectionAttribute | TSlateAttribute< EStretchDirection::Type > | The allowed direction of stretching of the content | Widgets/Layout/SScaleBox.h | |
| UserSpecifiedScaleAttribute | TSlateAttribute< float > | Optional scale that can be specified by the User | Widgets/Layout/SScaleBox.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Construct
(
const FArguments& InArgs |
Widgets/Layout/SScaleBox.h | ||
void SetContent
(
TSharedRef< SWidget > InContent |
See Content slot | Widgets/Layout/SScaleBox.h | |
void SetHAlign
(
EHorizontalAlignment HAlign |
See HAlign argument | Widgets/Layout/SScaleBox.h | |
void SetIgnoreInheritedScale
(
bool InIgnoreInheritedScale |
Set IgnoreInheritedScale argument | Widgets/Layout/SScaleBox.h | |
void SetOverrideScreenInformation
(
TOptional< FVector2D > InScreenSize |
Widgets/Layout/SScaleBox.h | ||
void SetStretch
(
EStretch::Type InStretch |
See Stretch argument | Widgets/Layout/SScaleBox.h | |
void SetStretchDirection
(
EStretchDirection::Type InStretchDirection |
See StretchDirection argument | Widgets/Layout/SScaleBox.h | |
void SetUserSpecifiedScale
(
float InUserSpecifiedScale |
See UserSpecifiedScale argument | Widgets/Layout/SScaleBox.h | |
void SetVAlign
(
EVerticalAlignment VAlign |
See VAlign argument | Widgets/Layout/SScaleBox.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnArrangeChildren
(
const FGeometry& AllottedGeometry, |
Widgets/Layout/SScaleBox.h | ||
virtual int32 OnPaint
(
const FPaintArgs& Args, |
Widgets/Layout/SScaleBox.h |
Overridden from FSlateControlledConstruction
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FSlateWidgetClassData & GetWidgetClass() |
Widgets/Layout/SScaleBox.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
float ComputeContentScale
(
const FGeometry& PaintGeometry |
Widgets/Layout/SScaleBox.h | ||
void DebugSafeAreaUpdated
(
const FMargin& NewSafeZone, |
Widgets/Layout/SScaleBox.h | ||
bool DoesScaleRequireNormalizingPrepassOrLocalGeometry() |
Widgets/Layout/SScaleBox.h | ||
void HandleSafeFrameChangedEvent() |
Widgets/Layout/SScaleBox.h | ||
bool IsDesiredSizeDependentOnAreaAndScale() |
Widgets/Layout/SScaleBox.h | ||
void RefreshSafeZoneScale() |
Widgets/Layout/SScaleBox.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FVector2D ComputeDesiredSize
(
float InScale |
Widgets/Layout/SScaleBox.h | ||
virtual bool CustomPrepass
(
float LayoutScaleMultiplier |
Widgets/Layout/SScaleBox.h | ||
virtual float GetRelativeLayoutScale
(
int32 ChildIndex, |
Widgets/Layout/SScaleBox.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static const FSlateWidgetClassData & GetPrivateWidgetClass() |
Widgets/Layout/SScaleBox.h | ||
static SLATE_API void PrivateRegisterAttributes
(
FSlateAttributeInitializer& |
Widgets/Layout/SScaleBox.h | ||
static const FSlateWidgetClassData & StaticWidgetClass() |
Widgets/Layout/SScaleBox.h |