FSlateRect

A rectangle defined by upper-left and lower-right corners.

References

Module

SlateCore

Header

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

Include

#include "Layout/SlateRect.h"

Syntax

class FSlateRect

Remarks

A rectangle defined by upper-left and lower-right corners.

Variables

Name Description

Public variable

float

 

Bottom

Public variable

float

 

Left

Public variable

float

 

Right

Public variable

float

 

Top

Constructors

Name Description

Public function

FSlateRect

(
    const UE::Slate::FDeprecateVector2D...,
    const UE::Slate::FDeprecateVector2D...
)

Public function

FSlateRect

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

Functions

Name Description

Public function Const

bool

 

ContainsPoint

(
    const UE::Slate::FDeprecateVector2D...
)

Returns whether or not a point is inside the rectangle

Public function Static

bool

 

DoRectanglesIntersect

(
    const FSlateRect& A,
    const FSlateRect& B
)

Do rectangles A and B intersect?

Public function Const

FSlateRect

 

Expand

(
    const FSlateRect& Other
)

Returns the rect that encompasses both rectangles

Public function Const

FSlateRect

 

ExtendBy

(
    const FMargin& ExtendAmount
)

Return a rectangle that is extended on each side by the amount specified in each margin.

Public function Static

FSlateRect

 

FromPointAndExtent

(
    const UE::Slate::FDeprecateVector2D...,
    const UE::Slate::FDeprecateVector2D...
)

Creates a rect from a top left point and extent.

Public function Const

float

 

GetArea()

Public function Const

UE::Slate::F...

 

GetBottomLeft()

Returns the bottom-left position of the rectangle

Public function Const

FVector2f

 

GetBottomLeft2f()

Public function Const

UE::Slate::F...

 

GetBottomRight()

Returns the bottom-right position of the rectangle

Public function Const

FVector2f

 

GetBottomRight2f()

Public function Const

UE::Slate::F...

 

GetCenter()

Returns the center of the rectangle

Public function Const

FVector2f

 

GetCenter2f()

Public function Const

UE::Slate::F...

 

GetSize()

Returns the size of the rectangle in each dimension.

Public function Const

FVector2f

 

GetSize2f()

Public function Const

UE::Slate::F...

 

GetTopLeft()

Returns the top-left position of the rectangle

Public function Const

FVector2f

 

GetTopLeft2f()

Public function Const

UE::Slate::F...

 

GetTopRight()

Returns the top-right position of the rectangle

Public function Const

FVector2f

 

GetTopRight2f()

Public function

bool

 

InitFromString

(
    const FString& InSourceString
)

Returns a string of containing the coordinates of the rect

Public function Const

FSlateRect

 

InsetBy

(
    const FMargin& InsetAmount
)

Return a rectangle that is contracted on each side by the amount specified in each margin.

Public function Const

FSlateRect

 

IntersectionWith

(
    const FSlateRect& Other
)

Returns the rectangle that is the intersection of this rectangle and Other.

Public function Const

FSlateRect

 

IntersectionWith

(
    const FSlateRect& Other,
    bool& OutOverlapping
)

Returns the rectangle that is the intersection of this rectangle and Other, as well as if they were overlapping at all.

Public function Const

bool

 

IsEmpty()

Public function Static

bool

 

IsRectangleContained

(
    const FSlateRect& A,
    const FSlateRect& B
)

Is rectangle B contained within rectangle A?

Public function Const

bool

 

IsValid()

Determines if the rectangle has positive dimensions.

Public function Const

FSlateRect

 

OffsetBy

(
    const UE::Slate::FDeprecateVector2D...
)

Return a rectangle that is offset by the amount specified .

Public function Const

FSlateRect

 

Round()

Rounds the Left, Top, Right and Bottom fields and returns a new FSlateRect with rounded components.

Public function Const

FSlateRect

 

ScaleBy

(
    float ScaleBy
)

Return a rectangle that is scaled by the amount specified.

Public function Const

FString

 

ToString()

Returns a string of containing the coordinates of the rect

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FSlateRect& Other
)

Public function Const

bool

 

operator==

(
    const FSlateRect& Other
)

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