RealDocs

USlateBlueprintLibrary::Vector_LocalToAbsolute

function UMG Blueprint Since 5.0
#include "Blueprint/SlateBlueprintLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Transforms a direction vector from a widget's local space into absolute (desktop or window) space. Unlike LocalToAbsolute for coordinates, this operates on vectors so it only applies the scale portion of the transform, not the translation.

Caveats & Gotchas

  • This function transforms a *vector* (direction/size), not a *coordinate* (position). It applies scale but not translation — use LocalToAbsolute if you need to convert a position.
  • Absolute space may be desktop space or window space depending on where the root of the widget hierarchy lives. The same absolute value means different things in windowed vs fullscreen mode.
  • Added in UE 5.0 to replace the now-deprecated TransformVectorLocalToAbsolute, which had inverted results and was removed in 5.6.

Signature

static UMG_API FVector2D Vector_LocalToAbsolute(const FGeometry& Geometry, FVector2D LocalVector)

Parameters

Name Type Description Default
Geometry const FGeometry& The geometry whose local space defines the input coordinate system.
LocalVector FVector2D A direction vector expressed in the local space of the given geometry.

Return Type

FVector2D

Example

Convert widget-local size vector to absolute space C++
// Get the widget's local size in absolute screen pixels
FGeometry Geo = MyWidget->GetCachedGeometry();
FVector2D LocalSize = FVector2D(100.f, 50.f);
FVector2D AbsoluteSize = USlateBlueprintLibrary::Vector_LocalToAbsolute(Geo, LocalSize);

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.