Viewport

Viewport

Windows
MacOS
Linux
On this page

Actions

Get Mouse Position on Platform

Gets the platform's mouse cursor position. This is the 'absolute' desktop location of the mouse.

Target is Widget Layout Library

Get Mouse Position on Viewport

Gets the platform's mouse cursor position in the local space of the viewport widget.

Target is Widget Layout Library

Get Mouse Position Scaled by DPI

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). //UE_DEPRECATED(4.17, "Use GetMousePositionOnViewport() instead. Optionally and for more options, you can use GetViewportWidgetGeometry and GetPlayerScreenWidgetGeometry are newly introduced to give you the geometry of the viewport and the player screen for widgets to help convert between spaces.")

Target is Widget Layout Library

Get Player Screen Widget Geometry

Gets the geometry of the widget holding all widgets added to the "Player Screen". You can use this geometry to convert between absolute and local space of widgets held on this widget.

Target is Widget Layout Library

Get Viewport Scale

Gets the current DPI Scale being applied to the viewport and all the Widgets.

Target is Widget Layout Library

Get Viewport Size

Gets the size of the game viewport.

Target is Widget Layout Library

Get Viewport Widget Geometry

Gets the geometry of the widget holding all widgets added to the "Viewport". You can use this geometry to convert between absolute and local space of widgets held on this widget.

Target is Widget Layout Library

Get Viewport World

Get Viewport World

Target is Viewport

Is Splitscreen Force Disabled

Returns the split screen state

Target is Gameplay Statics

Project World Location to Widget Position

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

Target is Widget Layout Library

Remove All Widgets

Removes all widgets from the viewport.

Target is Widget Layout Library

Set Force Disable Splitscreen

Enables split screen

Target is Gameplay Statics

Spawn

Spawn

Target is Viewport

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