FSlateRect

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

Windows
MacOS
Linux

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 FVector2D& InStartPos,
    const FVector2D& InEndPos
)

Public function

FSlateRect

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

Functions

Name Description

Public function Const

bool

 

ContainsPoint

(
    const FVector2D& Point
)

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 FVector2D& TopLeft,
    const FVector2D& Size
)

Creates a rect from a top left point and extent.

Public function Const

FVector2D

 

GetBottomLeft()

Returns the bottom-left position of the rectangle

Public function Const

FVector2D

 

GetBottomRight()

Returns the bottom-right position of the rectangle

Public function Const

FVector2D

 

GetCenter()

Returns the center of the rectangle

Public function Const

FVector2D

 

GetSize()

Returns the size of the rectangle.

Public function Const

FVector2D

 

GetTopLeft()

Returns the top-left position of the rectangle

Public function Const

FVector2D

 

GetTopRight()

Returns the top-right position of the rectangle

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 FVector2D& OffsetAmount
)

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
Dismiss