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.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback