FGeometry

Represents the position, size, and absolute position of a Widget in Slate.

Windows
MacOS
Linux

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Layout/Geometry.h

Include

#include "Layout/Geometry.h"

Syntax

struct FGeometry

Remarks

Represents the position, size, and absolute position of a Widget in Slate. The absolute location of a geometry is usually screen space or window space depending on where the geometry originated. Geometries are usually paired with a SWidget pointer in order to provide information about a specific widget (see FArrangedWidget ). A Geometry's parent is generally thought to be the Geometry of the the corresponding parent widget.

Variables

Name Description

Public variable

const FVector2D

 

AbsolutePosition

!!! DEPRECATED !!! These legacy public members should ideally not be referenced, as they do not account for the render transform.

Public variable

const FVector2D

 

Position

!!! DEPRECATED !!!

Public variable

const float

 

Scale

!!! DEPRECATED !!! These legacy public members should ideally not be referenced, as they do not account for the render transform.

Public variable

const FVector2D

 

Size

!!! DEPRECATED !!! Use GetLocalSize() accessor instead of directly accessing public members.

Constructors

Name Description

Public function

FGeometry()

Default constructor. Creates a geometry with identity transforms.

Public function

FGeometry

(
    const FVector2D & OffsetFromParent,
    const FVector2D & ParentAbsolutePos...,
    const FVector2D & InLocalSize,
    float InScale
)

!!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Construct a new geometry given the following parameters:

Functions

Name Description

Public function Const

FVector2D

 

AbsoluteToLocal

(
    FVector2D AbsoluteCoordinate
)

Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.

Public function

void

 

AppendTransform

(
    const FSlateLayoutTransform & Layou...
)

Special case method to append a layout transform to a geometry.

Public function Const

FVector2D

 

GetAbsolutePosition()

Get the absolute position in render space.

Public function Const

FVector2D

 

GetAbsolutePositionAtCoordinates

(
    const FVector2D & NormalCoordinates
)

Get the absolute position on the surface of the geometry using normalized coordinates.

Public function Const

FVector2D

 

GetAbsoluteSize()

Get the absolute size of the geometry in render space.

Public function Const

FSlateLayout ...

 

GetAccumulatedLayoutTransform()

Public function Const

const FSlate ...

 

GetAccumulatedRenderTransform()

Public function Const

FVector2D

 

GetDrawSize()

!!! DEPRECATED !!! This legacy function does not account for render transforms.

Public function Const

FSlateRect

 

GetLayoutBoundingRect

(
    const FSlateRect & LocalSpaceRect
)

Public function Const

FSlateRect

 

GetLayoutBoundingRect

(
    const FMargin & LocalSpaceExtendBy
)

Public function Const

FSlateRect

 

GetLayoutBoundingRect()

Public function Const

FVector2D

 

GetLocalPositionAtCoordinates

(
    const FVector2D & NormalCoordinates
)

Get the local position on the surface of the geometry using normalized coordinates.

Public function Const

const FVecto ...

 

GetLocalSize()

Public function Const

FSlateRect

 

GetRenderBoundingRect

(
    const FSlateRect & LocalSpaceRect
)

Public function Const

FSlateRect

 

GetRenderBoundingRect

(
    const FMargin & LocalSpaceExtendBy
)

Public function Const

FSlateRect

 

GetRenderBoundingRect()

Public function Const

bool

 

HasRenderTransform()

Public function Const

bool

 

IsUnderLocation

(
    const FVector2D & AbsoluteCoordinat...
)

Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.

Public function Const

FVector2D

 

LocalToAbsolute

(
    FVector2D LocalCoordinate
)

Translates local coordinates into absolute coordinates

Public function Const

FVector2D

 

LocalToRoundedLocal

(
    FVector2D LocalCoordinate
)

Translates the local coordinates into local coordinates that after being transformed into absolute space will be rounded to a whole number or approximately a whole number.

Public function Const

FArrangedWid ...

 

MakeChild

(
    const TSharedRef < SWidget >& Child...,
    const FVector2D & InLocalSize,
    const FSlateLayoutTransform & Layou...
)

FGeometry Arranged Widget Inlined Functions.

Public function Const

FGeometry

 

MakeChild

(
    const FVector2D & InLocalSize,
    const FSlateLayoutTransform & Layou...
)

Create a child geometry relative to this one with a given local space size, layout transform, and identity render transform.

Public function Const

FGeometry

 

MakeChild

(
    const FSlateRenderTransform & Rende...,
    const FVector2D & RenderTransformPi...
)

Public function Const

FArrangedWid ...

 

MakeChild

(
    const TSharedRef < SWidget >& Child...,
    const FLayoutGeometry & LayoutGeome...
)

Create a child geometry+widget relative to this one using the given LayoutGeometry.

Public function Const

FGeometry

 

MakeChild

(
    const FVector2D & ChildOffset,
    const FVector2D & InLocalSize,
    float ChildScale
)

!!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Create a child geometry relative to this one with a given local space size and layout transform given by a scale+offset.

Public function Const

FGeometry

 

MakeChild

(
    const FVector2D & InLocalSize,
    const FSlateLayoutTransform & Layou...,
    const FSlateRenderTransform & Rende...,
    const FVector2D & RenderTransformPi...
)

Create a child geometry relative to this one with a given local space size, layout transform, and render transform.

Public function Const

FArrangedWid ...

 

MakeChild

(
    const TSharedRef < SWidget >& Child...,
    const FVector2D & ChildOffset,
    const FVector2D & InLocalSize,
    float ChildScale
)

!!! DEPRECATED FUNCTION !!! Use MakeChild taking a layout transform instead! Create a child geometry+widget relative to this one with a given local space size and layout transform given by a scale+offset.

Public function Static

FGeometry

 

MakeRoot

(
    const FVector2D & InLocalSize,
    const FSlateLayoutTransform & Layou...
)

Makes a new geometry that is essentially the root of a hierarchy (has no parent transforms to inherit).

Public function Static

FGeometry

 

MakeRoot

(
    const FVector2D & InLocalSize,
    const FSlateLayoutTransform & Layou...,
    const FSlateRenderTransform & Rende...
)

Makes a new geometry that is essentially the root of a hierarchy (has no parent transforms to inherit).

Public function Const

FPaintGeomet ...

 

ToInflatedPaintGeometry

(
    const FVector2D & InflateAmount
)

Create a paint geometry relative to this one that whose local space is "inflated" by the specified amount in each direction.

Public function Const

FPaintGeomet ...

 

ToOffsetPaintGeometry

(
    const FVector2D & LocalOffset
)

!!! DEPRECATED FUNCTION !!! Use ToPaintGeometry taking a layout transform instead! Create a paint geometry relative to this one with the same size size and a given local space offset.

Public function Const

FPaintGeomet ...

 

ToPaintGeometry

(
    const FVector2D & InLocalSize,
    const FSlateLayoutTransform & InLay...
)

Create a paint geometry relative to this one with a given local space size and layout transform.

Public function Const

FPaintGeomet ...

 

ToPaintGeometry

(
    const FSlateLayoutTransform & Layou...
)

Create a paint geometry with the same size as this geometry with a given layout transform.

Public function Const

FPaintGeomet ...

 

ToPaintGeometry

(
    const FVector2D & InLocalSize,
    const FSlateLayoutTransform & InLay...,
    const FSlateRenderTransform & Rende...,
    const FVector2D & RenderTransformPi...
)

Create a paint geometry relative to this one with a given local space size and layout transform.

Public function Const

FPaintGeomet ...

 

ToPaintGeometry

(
    const FVector2D & InLocalOffset,
    const FVector2D & InLocalSize,
    float InLocalScale
)

!!! DEPRECATED FUNCTION !!! Use ToPaintGeometry taking a layout transform instead! Create a paint geometry relative to this one with a given local space size and layout transform given as a scale+offset.

Public function Const

FPaintGeomet ...

 

ToPaintGeometry()

Create a paint geometry that represents this geometry.

Public function Const

FString

 

ToString()

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FGeometry & Other
)

Test geometries for strict inequality (i.e. exact float equality negated).

Public function

FGeometry &

 

operator=

(
    const FGeometry & RHS
)

!!! HACK!!! We're keeping members of FGeometry const to prevent mutability without making them private, for backward compatibility.

Public function Const

bool

 

operator==

(
    const FGeometry & Other
)

Test geometries for strict equality (i.e. exact float equality).

Deprecated Functions

Name Description

Public function Const

FSlateRect

 

GetClippingRect()

This no longer represents any sort of clipping rect. Please use GetLayoutBoundingRect() to get the layout rect of this geometry.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback