Navigation
API > API/Runtime > API/Runtime/SlateCore
A rectangle defined by upper-left and lower-right corners.
Assumes a "screen-like" coordinate system where the origin is in the top-left, with the Y-axis going down. Functions like "contains" etc will not work with other conventions. +---------> X
| | (Left,Top)| o----o
| o----o | |
| (Right, Bottom) |
\/ Y
| Name | FSlateRect |
| Type | class |
| Header File | /Engine/Source/Runtime/SlateCore/Public/Layout/SlateRect.h |
| Include Path | #include "Layout/SlateRect.h" |
Syntax
class FSlateRect
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSlateRect
(
float InLeft, |
Layout/SlateRect.h | ||
FSlateRect
(
const UE::Slate::FDeprecateVector2DParameter& InStartPos, |
Layout/SlateRect.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Bottom | float | Layout/SlateRect.h | ||
| Left | float | Layout/SlateRect.h | ||
| Right | float | Layout/SlateRect.h | ||
| Top | float | Layout/SlateRect.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ContainsPoint
(
const UE::Slate::FDeprecateVector2DParameter& Point |
Returns whether or not a point is inside the rectangle | Layout/SlateRect.h | |
FSlateRect Expand
(
const FSlateRect& Other |
Returns the rect that encompasses both rectangles | Layout/SlateRect.h | |
FSlateRect ExtendBy
(
const FMargin& ExtendAmount |
Return a rectangle that is extended on each side by the amount specified in each margin. | Layout/SlateRect.h | |
float GetArea() |
Layout/SlateRect.h | ||
UE::Slate::FDeprecateVector2DResult GetBottomLeft() |
Returns the bottom-left position of the rectangle | Layout/SlateRect.h | |
FVector2f GetBottomLeft2f() |
Layout/SlateRect.h | ||
UE::Slate::FDeprecateVector2DResult GetBottomRight() |
Returns the bottom-right position of the rectangle | Layout/SlateRect.h | |
FVector2f GetBottomRight2f() |
Layout/SlateRect.h | ||
UE::Slate::FDeprecateVector2DResult GetCenter() |
Returns the center of the rectangle | Layout/SlateRect.h | |
FVector2f GetCenter2f() |
Layout/SlateRect.h | ||
UE::Slate::FDeprecateVector2DResult GetSize() |
Returns the size of the rectangle in each dimension. | Layout/SlateRect.h | |
FVector2f GetSize2f() |
Layout/SlateRect.h | ||
UE::Slate::FDeprecateVector2DResult GetTopLeft() |
Returns the top-left position of the rectangle | Layout/SlateRect.h | |
FVector2f GetTopLeft2f() |
Layout/SlateRect.h | ||
UE::Slate::FDeprecateVector2DResult GetTopRight() |
Returns the top-right position of the rectangle | Layout/SlateRect.h | |
FVector2f GetTopRight2f() |
Layout/SlateRect.h | ||
bool InitFromString
(
const FString& InSourceString |
Returns a string of containing the coordinates of the rect | Layout/SlateRect.h | |
FSlateRect InsetBy
(
const FMargin& InsetAmount |
Return a rectangle that is contracted on each side by the amount specified in each margin. | Layout/SlateRect.h | |
FSlateRect IntersectionWith
(
const FSlateRect& Other |
Returns the rectangle that is the intersection of this rectangle and Other. | Layout/SlateRect.h | |
FSlateRect IntersectionWith
(
const FSlateRect& Other, |
Returns the rectangle that is the intersection of this rectangle and Other, as well as if they were overlapping at all. | Layout/SlateRect.h | |
bool IsEmpty() |
Layout/SlateRect.h | ||
bool IsValid() |
Determines if the rectangle has positive dimensions. | Layout/SlateRect.h | |
FSlateRect OffsetBy
(
const UE::Slate::FDeprecateVector2DParameter& OffsetAmount |
Return a rectangle that is offset by the amount specified . | Layout/SlateRect.h | |
FSlateRect Round() |
Rounds the Left, Top, Right and Bottom fields and returns a new FSlateRect with rounded components. | Layout/SlateRect.h | |
FSlateRect ScaleBy
(
float ScaleBy |
Return a rectangle that is scaled by the amount specified. | Layout/SlateRect.h | |
FString ToString() |
Returns a string of containing the coordinates of the rect | Layout/SlateRect.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool DoRectanglesIntersect
(
const FSlateRect& A, |
Do rectangles A and B intersect? | Layout/SlateRect.h | |
static FSlateRect FromPointAndExtent
(
const UE::Slate::FDeprecateVector2DParameter& TopLeft, |
Creates a rect from a top left point and extent. | Layout/SlateRect.h | |
static bool IsRectangleContained
(
const FSlateRect& A, |
Is rectangle B contained within rectangle A? | Layout/SlateRect.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const FSlateRect& Other |
Layout/SlateRect.h | ||
bool operator==
(
const FSlateRect& Other |
Layout/SlateRect.h |