Navigation
API > API/Plugins > API/Plugins/Paper2D
A single piece of geometry (e.g., a polygon which may be convex or concave, a box, or a circle)
| Name | FSpriteGeometryShape |
| Type | struct |
| Header File | /Engine/Plugins/2D/Paper2D/Source/Paper2D/Classes/SpriteEditorOnlyTypes.h |
| Include Path | #include "SpriteEditorOnlyTypes.h" |
Syntax
USTRUCT ()
struct FSpriteGeometryShape
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSpriteGeometryShape() |
SpriteEditorOnlyTypes.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bNegativeWinding | bool | For Polygon geometry, this tells us if the winding should be negative (CW) regardless of the order in Vertices. | SpriteEditorOnlyTypes.h |
|
| BoxPosition | FVector2D | Center of the box or circle, acts as the pivot point for polygons (but may not be at the center of them) | SpriteEditorOnlyTypes.h |
|
| BoxSize | FVector2D | Size of the box or major/minor dimensions of the circle Note: Only valid when GeometryType is Box or Circle | SpriteEditorOnlyTypes.h |
|
| Rotation | float | Rotation of the shape (in degrees) | SpriteEditorOnlyTypes.h |
|
| ShapeType | ESpriteShapeType | The type of this piece of geometry. | SpriteEditorOnlyTypes.h |
|
| Vertices | TArray< FVector2D > | Vertices for the polygon (valid for Box and Polygon, but empty for Circle) | SpriteEditorOnlyTypes.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FVector2D ConvertShapeSpaceToTextureSpace
(
const FVector2D& ShapeSpacePoint |
SpriteEditorOnlyTypes.h | ||
FVector2D ConvertTextureSpaceToShapeSpace
(
const FVector2D& TextureSpacePoint |
SpriteEditorOnlyTypes.h | ||
FVector2D GetPolygonCentroid() |
Returns the polygon centroid in texture space. | SpriteEditorOnlyTypes.h | |
void GetTextureSpaceVertices
(
TArray< FVector2D >& InOutVertices |
SpriteEditorOnlyTypes.h | ||
bool IsShapeValid() |
Is this shape valid (e.g., at least 3 vertices for a polygon)? | SpriteEditorOnlyTypes.h | |
void SetNewPivot
(
const FVector2D& NewPosInTextureSpace |
Sets a new pivot and adjusts all vertices to be relative to it. | SpriteEditorOnlyTypes.h |