Navigation
Unreal Engine C++ API Reference > Runtime > SlateCore > Layout
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.
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
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
float | Bottom | |
![]() |
float | Left | |
![]() |
float | Right | |
![]() |
float | Top |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
FSlateRect
(
const UE::Slate::FDeprecateVector2DParameter& InStartPos, |
||
![]() |
FSlateRect
(
float InLeft, |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
bool | ContainsPoint
(
const UE::Slate::FDeprecateVector2DParameter& Point |
Returns whether or not a point is inside the rectangle |
![]() ![]() |
bool | DoRectanglesIntersect
(
const FSlateRect& A, |
Do rectangles A and B intersect? |
![]() ![]() |
FSlateRect | Expand
(
const FSlateRect& Other |
Returns the rect that encompasses both rectangles |
![]() ![]() |
FSlateRect | Return a rectangle that is extended on each side by the amount specified in each margin. | |
![]() ![]() |
FSlateRect | FromPointAndExtent
(
const UE::Slate::FDeprecateVector2DParameter& TopLeft, |
Creates a rect from a top left point and extent. |
![]() ![]() |
float | GetArea () |
|
![]() ![]() |
UE::Slate::FDeprecateVector2DResult | Returns the bottom-left position of the rectangle | |
![]() ![]() |
FVector2f | ||
![]() ![]() |
UE::Slate::FDeprecateVector2DResult | Returns the bottom-right position of the rectangle | |
![]() ![]() |
FVector2f | ||
![]() ![]() |
UE::Slate::FDeprecateVector2DResult | GetCenter () |
Returns the center of the rectangle |
![]() ![]() |
FVector2f | GetCenter2f () |
|
![]() ![]() |
UE::Slate::FDeprecateVector2DResult | GetSize () |
Returns the size of the rectangle in each dimension. |
![]() ![]() |
FVector2f | GetSize2f () |
|
![]() ![]() |
UE::Slate::FDeprecateVector2DResult | GetTopLeft () |
Returns the top-left position of the rectangle |
![]() ![]() |
FVector2f | GetTopLeft2f () |
|
![]() ![]() |
UE::Slate::FDeprecateVector2DResult | GetTopRight () |
Returns the top-right position of the rectangle |
![]() ![]() |
FVector2f | ||
![]() |
bool | InitFromString
(
const FString& InSourceString |
Returns a string of containing the coordinates of the rect |
![]() ![]() |
FSlateRect | Return a rectangle that is contracted on each side by the amount specified in each margin. | |
![]() ![]() |
FSlateRect | IntersectionWith
(
const FSlateRect& Other |
Returns the rectangle that is the intersection of this rectangle and Other. |
![]() ![]() |
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. |
![]() ![]() |
bool | IsEmpty () |
|
![]() ![]() |
bool | IsRectangleContained
(
const FSlateRect& A, |
Is rectangle B contained within rectangle A? |
![]() ![]() |
bool | IsValid () |
Determines if the rectangle has positive dimensions. |
![]() ![]() |
FSlateRect | OffsetBy
(
const UE::Slate::FDeprecateVector2DParameter& OffsetAmount |
Return a rectangle that is offset by the amount specified . |
![]() ![]() |
FSlateRect | Round () |
Rounds the Left, Top, Right and Bottom fields and returns a new FSlateRect with rounded components. |
![]() ![]() |
FSlateRect | ScaleBy
(
float ScaleBy |
Return a rectangle that is scaled by the amount specified. |
![]() ![]() |
FString | ToString () |
Returns a string of containing the coordinates of the rect |
Operators
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
bool | operator!=
(
const FSlateRect& Other |
|
![]() ![]() |
bool | operator==
(
const FSlateRect& Other |