engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
FSlateRect类 参考

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

#include <SlateRect.h>

Public 成员函数

FORCEINLINE bool ContainsPoint (const FVector2D &Point) const
 Returns whether or not a point is inside the rectangle 更多...
 
FORCEINLINE FSlateRect Expand (const FSlateRect &Other) const
 Returns the rect that encompasses both rectangles 更多...
 
FORCEINLINE FSlateRect ExtendBy (const FMargin &ExtendAmount) const
 Return a rectangle that is extended on each side by the amount specified in each margin. 更多...
 
FORCEINLINE FVector2D GetBottomLeft () const
 Returns the bottom-left position of the rectangle 更多...
 
FORCEINLINE FVector2D GetBottomRight () const
 Returns the bottom-right position of the rectangle 更多...
 
FORCEINLINE FVector2D GetCenter () const
 Returns the center of the rectangle 更多...
 
FORCEINLINE FVector2D GetSize () const
 Returns the size of the rectangle. 更多...
 
FORCEINLINE FVector2D GetTopLeft () const
 Returns the top-left position of the rectangle 更多...
 
FORCEINLINE FVector2D GetTopRight () const
 Returns the top-right position of the rectangle 更多...
 
bool InitFromString (const FString &InSourceString)
 Returns a string of containing the coordinates of the rect 更多...
 
FORCEINLINE FSlateRect InsetBy (const struct FMargin &InsetAmount) const
 Return a rectangle that is contracted on each side by the amount specified in each margin. 更多...
 
FORCEINLINE FSlateRect IntersectionWith (const FSlateRect &Other) const
 Returns the rectangle that is the intersection of this rectangle and Other. 更多...
 
FSlateRect IntersectionWith (const FSlateRect &Other, bool &OutOverlapping) const
 Returns the rectangle that is the intersection of this rectangle and Other, as well as if they were overlapping at all. 更多...
 
FORCEINLINE bool IsEmpty () const
 
FORCEINLINE bool IsValid () const
 Determines if the rectangle has positive dimensions.
 
FORCEINLINE FSlateRect OffsetBy (const FVector2D &OffsetAmount) const
 Return a rectangle that is offset by the amount specified . 更多...
 
FORCEINLINE FSlateRect Round () const
 Rounds the Left, Top, Right and Bottom fields and returns a new FSlateRect with rounded components.
 
FORCEINLINE FSlateRect ScaleBy (float ScaleBy) const
 Return a rectangle that is scaled by the amount specified. 更多...
 
FString ToString () const
 Returns a string of containing the coordinates of the rect 更多...
 

静态 Public 成员函数

static bool DoRectanglesIntersect (const FSlateRect &A, const FSlateRect &B)
 Do rectangles A and B intersect?
 
static FSlateRect FromPointAndExtent (const FVector2D &TopLeft, const FVector2D &Size)
 Creates a rect from a top left point and extent. 更多...
 
static FORCEINLINE bool IsRectangleContained (const FSlateRect &A, const FSlateRect &B)
 Is rectangle B contained within rectangle A?
 

详细描述

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

成员函数说明

◆ ContainsPoint()

FORCEINLINE bool FSlateRect::ContainsPoint ( const FVector2D &  Point) const
inline

Returns whether or not a point is inside the rectangle

参数
PointThe point to check
返回
True if the point is inside the rectangle

◆ Expand()

FORCEINLINE FSlateRect FSlateRect::Expand ( const FSlateRect &  Other) const
inline

Returns the rect that encompasses both rectangles

参数
OtherThe other rectangle
返回
Rectangle that is big enough to fit both rectangles

◆ ExtendBy()

FORCEINLINE FSlateRect FSlateRect::ExtendBy ( const FMargin &  ExtendAmount) const
inline

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

参数
ExtendAmountThe amount to extend the geometry.
返回
An extended rectangle.

◆ FromPointAndExtent()

static FSlateRect FSlateRect::FromPointAndExtent ( const FVector2D &  TopLeft,
const FVector2D &  Size 
)
inlinestatic

Creates a rect from a top left point and extent.

Provided as a factory function to not conflict with the TopLeft + BottomRight ctor.

◆ GetBottomLeft()

FORCEINLINE FVector2D FSlateRect::GetBottomLeft ( ) const
inline

Returns the bottom-left position of the rectangle

返回
The bottom-left position.

◆ GetBottomRight()

FORCEINLINE FVector2D FSlateRect::GetBottomRight ( ) const
inline

Returns the bottom-right position of the rectangle

返回
The bottom-right position.

◆ GetCenter()

FORCEINLINE FVector2D FSlateRect::GetCenter ( ) const
inline

Returns the center of the rectangle

返回
The center point.

◆ GetSize()

FORCEINLINE FVector2D FSlateRect::GetSize ( ) const
inline

Returns the size of the rectangle.

返回
The size as a vector.

◆ GetTopLeft()

FORCEINLINE FVector2D FSlateRect::GetTopLeft ( ) const
inline

Returns the top-left position of the rectangle

返回
The top-left position.

◆ GetTopRight()

FORCEINLINE FVector2D FSlateRect::GetTopRight ( ) const
inline

Returns the top-right position of the rectangle

返回
The top-right position.

◆ InitFromString()

bool FSlateRect::InitFromString ( const FString &  InSourceString)

Returns a string of containing the coordinates of the rect

参数
InSourceStringA string containing the values to initialize this rect in format Left=Value Top=Value...
返回
True if initialized successfully

◆ InsetBy()

FORCEINLINE FSlateRect FSlateRect::InsetBy ( const struct FMargin &  InsetAmount) const
inline

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

参数
InsetAmountThe amount to contract the geometry.
返回
An inset rectangle.

◆ IntersectionWith() [1/2]

FORCEINLINE FSlateRect FSlateRect::IntersectionWith ( const FSlateRect &  Other) const
inline

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

参数
OtherThe other rectangle
返回
Rectangle over intersection.

◆ IntersectionWith() [2/2]

FSlateRect FSlateRect::IntersectionWith ( const FSlateRect &  Other,
bool &  OutOverlapping 
) const
inline

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

参数
OtherThe other rectangle
OutOverlapping[Out] Was there any overlap with the other rectangle.
返回
Rectangle over intersection.

◆ IsEmpty()

FORCEINLINE bool FSlateRect::IsEmpty ( ) const
inline
返回
true, if the rectangle has a size of 0.

◆ OffsetBy()

FORCEINLINE FSlateRect FSlateRect::OffsetBy ( const FVector2D &  OffsetAmount) const
inline

Return a rectangle that is offset by the amount specified .

参数
OffsetAmountThe amount to contract the geometry.
返回
An offset rectangle.

◆ ScaleBy()

FORCEINLINE FSlateRect FSlateRect::ScaleBy ( float  ScaleBy) const
inline

Return a rectangle that is scaled by the amount specified.

参数
ScaleByThe amount to scale the geometry.
返回
An scaled rectangle.

◆ ToString()

FString FSlateRect::ToString ( ) const

Returns a string of containing the coordinates of the rect

返回
A string of the rect coordinates

该类的文档由以下文件生成: