UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ISlateViewport Class Referenceabstract

#include <RenderingCommon.h>

+ Inheritance diagram for ISlateViewport:

Public Member Functions

virtual ~ISlateViewport ()
 
virtual void OnDrawViewport (const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, class FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled)
 
virtual FIntPoint GetSize () const =0
 
virtual class FSlateShaderResourceGetViewportRenderTargetTexture () const =0
 
virtual EPixelFormat GetSceneTargetFormat () const
 
virtual bool IsViewportTextureAlphaOnly () const
 
virtual bool IsStereoscopic3D () const
 
virtual bool UseSeparateRenderTarget () const
 
virtual ESlateViewportDynamicRange GetViewportDynamicRange () const
 
virtual void Tick (const FGeometry &AllottedGeometry, double InCurrentTime, float DeltaTime)
 
virtual bool RequiresVsync () const =0
 
virtual bool AllowScaling () const
 
virtual FCursorReply OnCursorQuery (const FGeometry &MyGeometry, const FPointerEvent &CursorEvent)
 
virtual TOptional< TSharedRef< SWidget > > OnMapCursor (const FCursorReply &CursorReply)
 
virtual bool IsSoftwareCursorVisible () const
 
virtual FVector2D GetSoftwareCursorPosition () const
 
virtual FReply OnMouseButtonDown (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 
virtual FReply OnMouseButtonUp (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 
virtual void OnMouseEnter (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 
virtual void OnMouseLeave (const FPointerEvent &MouseEvent)
 
virtual FReply OnMouseMove (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 
virtual FReply OnMouseWheel (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 
virtual FReply OnMouseButtonDoubleClick (const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent)
 
virtual FReply OnKeyDown (const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent)
 
virtual FReply OnKeyUp (const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent)
 
virtual FReply OnAnalogValueChanged (const FGeometry &MyGeometry, const FAnalogInputEvent &InAnalogInputEvent)
 
virtual FReply OnKeyChar (const FGeometry &MyGeometry, const FCharacterEvent &InCharacterEvent)
 
virtual FReply OnFocusReceived (const FFocusEvent &InFocusEvent)
 
virtual FReply OnTouchStarted (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 
virtual FReply OnTouchMoved (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 
virtual FReply OnTouchEnded (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 
virtual FReply OnTouchForceChanged (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 
virtual FReply OnTouchFirstMove (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent)
 
virtual FReply OnTouchGesture (const FGeometry &MyGeometry, const FPointerEvent &InGestureEvent)
 
virtual FReply OnMotionDetected (const FGeometry &MyGeometry, const FMotionEvent &InMotionEvent)
 
virtual TOptional< boolOnQueryShowFocus (const EFocusCause InFocusCause) const
 
virtual void OnFinishedPointerInput ()
 
virtual FPopupMethodReply OnQueryPopupMethod () const
 
virtual FNavigationReply OnNavigation (const FGeometry &MyGeometry, const FNavigationEvent &InNavigationEvent)
 
virtual bool HandleNavigation (const uint32 InUserIndex, TSharedPtr< SWidget > InDestination)
 
virtual void OnFocusLost (const FFocusEvent &InFocusEvent)
 
virtual FReply OnRequestWindowClose ()
 
virtual void OnViewportClosed ()
 
virtual TWeakPtr< SWidgetGetWidget ()
 
virtual FReply OnViewportActivated (const FWindowActivateEvent &InActivateEvent)
 
virtual void OnViewportDeactivated (const FWindowActivateEvent &InActivateEvent)
 

Detailed Description

Viewport implementation interface that is used by SViewport when it needs to draw and processes input.

Constructor & Destructor Documentation

◆ ~ISlateViewport()

virtual ISlateViewport::~ISlateViewport ( )
inlinevirtual

Member Function Documentation

◆ AllowScaling()

virtual bool ISlateViewport::AllowScaling ( ) const
inlinevirtual

Whether the viewport contents should be scaled or not. Defaults to true.

◆ GetSceneTargetFormat()

virtual EPixelFormat ISlateViewport::GetSceneTargetFormat ( ) const
inlinevirtual

Returns format for the scene of this viewport, only valid if this viewport actually has a scene, else PF_Unknown.

Reimplemented in FSceneViewport.

◆ GetSize()

virtual FIntPoint ISlateViewport::GetSize ( ) const
pure virtual

Returns the size of the viewport

Implemented in FSceneViewport, FMovieViewport, FBackgroundView, and FWebBrowserViewport.

◆ GetSoftwareCursorPosition()

virtual FVector2D ISlateViewport::GetSoftwareCursorPosition ( ) const
inlinevirtual

Returns the current position of the software cursor

Reimplemented in FSceneViewport.

◆ GetViewportDynamicRange()

virtual ESlateViewportDynamicRange ISlateViewport::GetViewportDynamicRange ( ) const
inlinevirtual

Does the texture contain SDR/HDR information

Reimplemented in FSceneViewport.

◆ GetViewportRenderTargetTexture()

virtual class FSlateShaderResource * ISlateViewport::GetViewportRenderTargetTexture ( ) const
pure virtual

Returns a slate texture used to draw the rendered viewport in Slate.

Implemented in FSceneViewport, FMovieViewport, FBackgroundView, and FWebBrowserViewport.

◆ GetWidget()

virtual TWeakPtr< SWidget > ISlateViewport::GetWidget ( )
inlinevirtual

Gets the SWidget associated with this viewport

Reimplemented in FSceneViewport.

◆ HandleNavigation()

virtual bool ISlateViewport::HandleNavigation ( const uint32  InUserIndex,
TSharedPtr< SWidget InDestination 
)
inlinevirtual

Give the viewport an opportunity to override the navigation behavior. This is called after all the navigation event bubbling is complete and we know a destination.

Parameters
InDestinationThe destination widget
Returns
whether we handled the navigation

Reimplemented in FSceneViewport.

◆ IsSoftwareCursorVisible()

virtual bool ISlateViewport::IsSoftwareCursorVisible ( ) const
inlinevirtual

Returns whether the software cursor is currently visible

Reimplemented in FSceneViewport.

◆ IsStereoscopic3D()

virtual bool ISlateViewport::IsStereoscopic3D ( ) const
inlinevirtual

Does the texture returned by GetViewportRenderTargetTexture represent a stereoscopic 3D target?

◆ IsViewportTextureAlphaOnly()

virtual bool ISlateViewport::IsViewportTextureAlphaOnly ( ) const
inlinevirtual

Does the texture returned by GetViewportRenderTargetTexture only have an alpha channel?

◆ OnAnalogValueChanged()

virtual FReply ISlateViewport::OnAnalogValueChanged ( const FGeometry MyGeometry,
const FAnalogInputEvent InAnalogInputEvent 
)
inlinevirtual

Called when an analog value changes on a button that supports analog

Parameters
MyGeometryThe Geometry of the widget receiving the event
InAnalogInputEventAnalog input event
Returns
Returns whether the event was handled, along with other possible actions

Reimplemented in FSceneViewport.

◆ OnCursorQuery()

virtual FCursorReply ISlateViewport::OnCursorQuery ( const FGeometry MyGeometry,
const FPointerEvent CursorEvent 
)
inlinevirtual

Called when Slate needs to know what the mouse cursor should be.

Returns
FCursorReply::Unhandled() if the event is not handled; FCursorReply::Cursor() otherwise.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnDrawViewport()

virtual void ISlateViewport::OnDrawViewport ( const FGeometry AllottedGeometry,
const FSlateRect MyCullingRect,
class FSlateWindowElementList OutDrawElements,
int32  LayerId,
const FWidgetStyle InWidgetStyle,
bool  bParentEnabled 
)
inlinevirtual

Called by Slate when the viewport widget is drawn Implementers of this interface can use this method to perform custom per draw functionality. This is only called if the widget is visible

Parameters
AllottedGeometryThe geometry of the viewport widget

Reimplemented in FSceneViewport.

◆ OnFinishedPointerInput()

virtual void ISlateViewport::OnFinishedPointerInput ( )
inlinevirtual

Called after all input for this frame is processed.

Reimplemented in FSceneViewport.

◆ OnFocusLost()

virtual void ISlateViewport::OnFocusLost ( const FFocusEvent InFocusEvent)
inlinevirtual

Called when the viewport loses keyboard focus.

Parameters
InFocusEventInformation about what caused the viewport to lose focus

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnFocusReceived()

virtual FReply ISlateViewport::OnFocusReceived ( const FFocusEvent InFocusEvent)
inlinevirtual

Called when the viewport gains keyboard focus.

Parameters
InFocusEventInformation about what caused the viewport to gain focus

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnKeyChar()

virtual FReply ISlateViewport::OnKeyChar ( const FGeometry MyGeometry,
const FCharacterEvent InCharacterEvent 
)
inlinevirtual

Called by Slate when a character key is pressed while the viewport has focus

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the character that was pressed
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnKeyDown()

virtual FReply ISlateViewport::OnKeyDown ( const FGeometry MyGeometry,
const FKeyEvent InKeyEvent 
)
inlinevirtual

Called by Slate when a key is pressed inside the viewport

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the key event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnKeyUp()

virtual FReply ISlateViewport::OnKeyUp ( const FGeometry MyGeometry,
const FKeyEvent InKeyEvent 
)
inlinevirtual

Called by Slate when a key is released inside the viewport

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the key event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnMapCursor()

virtual TOptional< TSharedRef< SWidget > > ISlateViewport::OnMapCursor ( const FCursorReply CursorReply)
inlinevirtual

After OnCursorQuery has specified a cursor type the system asks each widget under the mouse to map that cursor to a widget. This event is bubbled.

Returns
TOptional<TSharedRef<SWidget>>() if you don't have a mapping otherwise return the Widget to show.

Reimplemented in FSceneViewport.

◆ OnMotionDetected()

virtual FReply ISlateViewport::OnMotionDetected ( const FGeometry MyGeometry,
const FMotionEvent InMotionEvent 
)
inlinevirtual

Called when motion is detected (controller or device) e.g. Someone tilts or shakes their controller.

Parameters
InMotionEventThe motion event generated

Reimplemented in FSceneViewport.

◆ OnMouseButtonDoubleClick()

virtual FReply ISlateViewport::OnMouseButtonDoubleClick ( const FGeometry InMyGeometry,
const FPointerEvent InMouseEvent 
)
inlinevirtual

Called by Slate when the mouse wheel is used inside the viewport

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the mouse event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnMouseButtonDown()

virtual FReply ISlateViewport::OnMouseButtonDown ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
inlinevirtual

Called by Slate when a mouse button is pressed inside the viewport

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the mouse event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnMouseButtonUp()

virtual FReply ISlateViewport::OnMouseButtonUp ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
inlinevirtual

Called by Slate when a mouse button is released inside the viewport

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the mouse event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnMouseEnter()

virtual void ISlateViewport::OnMouseEnter ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
inlinevirtual

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnMouseLeave()

virtual void ISlateViewport::OnMouseLeave ( const FPointerEvent MouseEvent)
inlinevirtual

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnMouseMove()

virtual FReply ISlateViewport::OnMouseMove ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
inlinevirtual

Called by Slate when a mouse button is released inside the viewport

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the mouse event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnMouseWheel()

virtual FReply ISlateViewport::OnMouseWheel ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
inlinevirtual

Called by Slate when the mouse wheel is used inside the viewport

Parameters
MyGeometryInformation about the location and size of the viewport
MouseEventInformation about the mouse event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented in FSceneViewport, and FWebBrowserViewport.

◆ OnNavigation()

virtual FNavigationReply ISlateViewport::OnNavigation ( const FGeometry MyGeometry,
const FNavigationEvent InNavigationEvent 
)
inlinevirtual

Called when navigation is requested e.g. Left Joystick, Direction Pad, Arrow Keys can generate navigation events.

Parameters
InNavigationEventThe navigation event generated

◆ OnQueryPopupMethod()

virtual FPopupMethodReply ISlateViewport::OnQueryPopupMethod ( ) const
inlinevirtual

Called to figure out whether we can make new windows for popups within this viewport. Making windows allows us to have popups that go outside the parent window, but cannot be used in fullscreen and do not have per-pixel alpha.

Reimplemented in FSceneViewport.

◆ OnQueryShowFocus()

virtual TOptional< bool > ISlateViewport::OnQueryShowFocus ( const EFocusCause  InFocusCause) const
inlinevirtual

Called to determine if we should render the focus brush.

Parameters
InFocusCauseThe cause of focus

Reimplemented in FSceneViewport.

◆ OnRequestWindowClose()

virtual FReply ISlateViewport::OnRequestWindowClose ( )
inlinevirtual

Called when the top level window associated with the viewport has been requested to close. At this point, the viewport has not been closed and the operation may be canceled. This may not called from PIE, Editor Windows, on consoles, or before the game ends from other methods. This is only when the platform specific window is closed.

Returns
FReply::Handled if the close event was consumed (and the window should remain open).

Reimplemented in FSceneViewport.

◆ OnTouchEnded()

virtual FReply ISlateViewport::OnTouchEnded ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
inlinevirtual

Called when a touchpad touch is ended (finger lifted)

Parameters
ControllerEventThe controller event generated

Reimplemented in FSceneViewport.

◆ OnTouchFirstMove()

virtual FReply ISlateViewport::OnTouchFirstMove ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
inlinevirtual

Called when a touchpad touch has first moved after initial press

Parameters
ControllerEventThe controller event generated

Reimplemented in FSceneViewport.

◆ OnTouchForceChanged()

virtual FReply ISlateViewport::OnTouchForceChanged ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
inlinevirtual

Called when a touchpad touch force changes, but may or may not have moved

Parameters
ControllerEventThe controller event generated

Reimplemented in FSceneViewport.

◆ OnTouchGesture()

virtual FReply ISlateViewport::OnTouchGesture ( const FGeometry MyGeometry,
const FPointerEvent InGestureEvent 
)
inlinevirtual

Called on a touchpad gesture event

Parameters
InGestureEventThe touch event generated

Reimplemented in FWebBrowserViewport, and FSceneViewport.

◆ OnTouchMoved()

virtual FReply ISlateViewport::OnTouchMoved ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
inlinevirtual

Called when a touchpad touch is moved (finger moved)

Parameters
ControllerEventThe controller event generated

Reimplemented in FSceneViewport.

◆ OnTouchStarted()

virtual FReply ISlateViewport::OnTouchStarted ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
inlinevirtual

Called when a touchpad touch is started (finger down)

Parameters
ControllerEventThe controller event generated

Reimplemented in FSceneViewport.

◆ OnViewportActivated()

virtual FReply ISlateViewport::OnViewportActivated ( const FWindowActivateEvent InActivateEvent)
inlinevirtual

Called when the viewports top level window is being Activated

Reimplemented in FSceneViewport.

◆ OnViewportClosed()

virtual void ISlateViewport::OnViewportClosed ( )
inlinevirtual

Called when the viewport has been requested to close.

Reimplemented in FSceneViewport.

◆ OnViewportDeactivated()

virtual void ISlateViewport::OnViewportDeactivated ( const FWindowActivateEvent InActivateEvent)
inlinevirtual

Called when the viewports top level window is being Deactivated

Reimplemented in FSceneViewport.

◆ RequiresVsync()

virtual bool ISlateViewport::RequiresVsync ( ) const
pure virtual

Returns true if the viewport should be vsynced.

Implemented in FSceneViewport, FMovieViewport, FBackgroundView, and FWebBrowserViewport.

◆ Tick()

virtual void ISlateViewport::Tick ( const FGeometry AllottedGeometry,
double  InCurrentTime,
float  DeltaTime 
)
inlinevirtual

Performs any ticking necessary by this handle

Reimplemented in FWebBrowserViewport, and FSceneViewport.

◆ UseSeparateRenderTarget()

virtual bool ISlateViewport::UseSeparateRenderTarget ( ) const
inlinevirtual

Is the viewport expected to render to GetViewportRenderTargetTexture? Or to the swapchain?


The documentation for this class was generated from the following file: