UWidgetLayoutLibrary::ProjectWorldLocationToWidgetPosition

Gets the projected world to screen position for a player, then converts it into a widget position, which takes into account any quality scaling.

Windows
MacOS
Linux

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Blueprint/WidgetLayoutLibrary.h

Include

#include "Blueprint/WidgetLayoutLibrary.h"

Source

/Engine/Source/Runtime/UMG/Private/WidgetLayoutLibrary.cpp

Syntax

static bool ProjectWorldLocationToWidgetPosition
(
    APlayerController * PlayerController,
    FVector WorldLocation,
    FVector2D & ScreenPosition,
    bool bPlayerViewportRelative
)

Remarks

Gets the projected world to screen position for a player, then converts it into a widget position, which takes into account any quality scaling.

Returns

true if the position projects onto the screen.

Parameters

Parameter

Description

PlayerController

The player controller to project the position in the world to their screen.

WorldLocation

The world location to project from.

ScreenPosition

The position in the viewport with quality scale removed and DPI scale remove.

bPlayerViewportRelative

Should this be relative to the player viewport subregion (useful when using player attached widgets in split screen or when aspect-ratio constrained)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss