Navigation
API > API/Runtime > API/Runtime/UMG > API/Runtime/UMG/Blueprint > API/Runtime/UMG/Blueprint/UWidgetLayoutLibrary > API/Runtime/UMG/Blueprint/UWidgetLayoutLibrary/GetMousePositionScaledByDPI
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 |
UFUNCTION (BlueprintPure, BlueprintCosmetic, Category="Viewport")
static bool GetMousePositionScaledByDPI
(
APlayerController * Player,
float & LocationX,
float & LocationY
)
Remarks
Gets the mouse position of the player controller, scaled by the DPI. If you're trying to go from raw mouse screenspace coordinates to fullscreen widget space, you'll need to transform the mouse into DPI Scaled space. This function performs that scaling.
MousePositionScaledByDPI = MousePosition * (1 / ViewportScale).