FMargin

Describes the space around a Widget.

Windows
MacOS
Linux

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Layout/Margin.h

Include

#include "Layout/Margin.h"

Syntax

struct FMargin

Remarks

Describes the space around a Widget.

Variables

Name Description

Public variable

float

 

Bottom

Holds the margin to the bottom.

Public variable

float

 

Left

Holds the margin to the left.

Public variable

float

 

Right

Holds the margin to the right.

Public variable

float

 

Top

Holds the margin to the top.

Constructors

Name Description

Public function

FMargin()

Default constructor.

The default margin size is zero on all four sides..

Public function

FMargin

(
    float UniformMargin
)

Construct a Margin with uniform space on all sides

Public function

FMargin

(
    const FVector2D& InVector
)

Construct a Margin where Horizontal describes Left and Right spacing while Vertical describes Top and Bottom spacing

Public function

FMargin

(
    const FVector4& InVector
)

Construct a Margin where the margins are coming from a FVector4

Public function

FMargin

(
    float Horizontal,
    float Vertical
)

Construct a Margin where Horizontal describes Left and Right spacing while Vertical describes Top and Bottom spacing

Public function

FMargin

(
    float InLeft,
    float InTop,
    float InRight,
    float InBottom
)

Construct a Margin where the spacing on each side is individually specified.

Functions

Name Description

Public function Const

FVector2D

 

GetDesiredSize()

Gets the margin's total size.

Public function Const

FVector2D

 

GetTopLeft()

Gets the offset for the top left.

Public function Const

float

 

GetTotalSpaceAlong()

Gets the total horizontal or vertical margin.

Public function Const

float

 

GetTotalSpaceAlong()

Public function Const

float

 

GetTotalSpaceAlong()

Operators

Name Description

Public function Const

FMargin

 

operator-

(
    const FMargin& Other
)

Subtracts another margin from this margin.

Public function Const

bool

 

operator!=

(
    const FMargin& Other
)

Compares this margin with another for inequality.

Public function Const

FMargin

 

operator*

(
    float Scale
)

Multiply the margin by a scalar.

Public function Const

FMargin

 

operator*

(
    const FMargin& InScale
)

Multiply the margin by another margin functioning as the scale.

Public function Const

FMargin

 

operator+

(
    const FMargin& InDelta
)

Adds another margin to this margin.

Public function Const

bool

 

operator==

(
    const FMargin& Other
)

Compares this margin with another for equality.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss