SViewport

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/SViewport.h

Include

#include "Widgets/SViewport.h"

Syntax

class SViewport : public SCompoundWidget

Variables

Name Description

Protected variable

TWeakPtr< ISlateViewport >

 

ViewportInterface

Interface to the rendering and I/O implementation of the viewport.

Constructors

Name Description

Public function

SViewport()

Default constructor.

Functions

Name Description

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Construct the widget.

Public function

void

 

EnableStereoRendering

(
    const bool bInEnableStereoRendering
)

Sets whether stereo rendering is allowed for this viewport. Advanced use only

Protected function

EActiveTimerReturnType

 

EnsureTick

(
    double InCurrentTime,
    float InDeltaTime
)

Empty active timer meant to ensure a tick/paint pass while this viewport is active

Public function Const

const TSharedPtr< SWidget >

 

GetContent()

Public function

TSharedPtr< ICustomHitTestPath >

 

GetCustomHitTestPath()

Public function Const

bool

 

GetIgnoreTextureAlpha()

Public function

TWeakPtr< ISlateViewport >

 

GetViewportInterface()

Sets the interface to be used by this viewport for rendering and I/O

Public function Const

bool

 

IsStereoRenderingAllowed()

Public function

FReply

 

OnViewportActivated

(
    const FWindowActivateEvent& InActivateEvent
)

A delegate called when the viewports top level window is deactivated

Public function

void

 

OnViewportDeactivated

(
    const FWindowActivateEvent& InActivateEvent
)

A delegate called when the viewports top level window is deactivated

Public function

void

 

OnWindowClosed

(
    const TSharedRef< SWindow >& InWindowBeingClosed
)

A delegate called when the viewports top level window is being closed

Public function

void

 

SetActive

(
    bool bActive
)

Sets whether this viewport is active.

Public function

void

 

SetContent

(
    TSharedPtr< SWidget > InContent
)

Sets the content for this widget

Public function

void

 

SetCustomHitTestPath

(
    TSharedPtr< ICustomHitTestPath > CustomHitTestPath
)

Public function

void

 

SetIgnoreTextureAlpha

(
    const bool bInIgnoreTextureAlpha
)

If true, the viewport's texture alpha is ignored when performing blending.

Public function

void

 

SetRenderDirectlyToWindow

(
    const bool bInRenderDirectlyToWindow
)

Sets whether this viewport can render directly to the back buffer. Advanced use only

Public function

void

 

SetViewportInterface

(
    TSharedRef< ISlateViewport > InViewportInterface
)

Sets the interface to be used by this viewport for rendering and I/O

Public function Const

bool

 

ShouldRenderDirectly()

Overridden from SWidget

Name Description

Public function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float
)

Computes the ideal size necessary to display this widget.

Public function Virtual

FReply

 

OnAnalogValueChanged

(
    const FGeometry& MyGeometry,
    const FAnalogInputEvent& InAnalogInputEvent
)

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

Public function Virtual Const

void

 

OnArrangeChildren

(
    const FGeometry& AllottedGeometry,
    FArrangedChildren& ArrangedChildren
)

Compute the Geometry of all the children and add populate the ArrangedChildren list with their values.

Public function Virtual Const

FCursorReply

 

OnCursorQuery

(
    const FGeometry& MyGeometry,
    const FPointerEvent& CursorEvent
)

The system asks each widget under the mouse to provide a cursor. This event is bubbled.

Public function Virtual

void

 

OnFinishedPointerInput()

All the pointer (mouse, touch, stylus, etc.) events from this frame have been routed.

Public function Virtual

void

 

OnFocusLost

(
    const FFocusEvent& InFocusEvent
)

Called when this widget loses focus. This event does not bubble.

Public function Virtual

FReply

 

OnFocusReceived

(
    const FGeometry& MyGeometry,
    const FFocusEvent& InFocusEvent
)

KEY INPUT Called when focus is given to this widget. This event does not bubble.

Public function Virtual

FReply

 

OnKeyChar

(
    const FGeometry& MyGeometry,
    const FCharacterEvent& InCharacterEvent
)

Called after a character is entered while this widget has keyboard focus

Public function Virtual

FReply

 

OnKeyDown

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is pressed when this widget has focus (this event bubbles if not handled)

Public function Virtual

FReply

 

OnKeyUp

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is released when this widget has focus

Public function Virtual Const

TOptional< TSharedRef< SWidget > >

 

OnMapCursor

(
    const FCursorReply& CursorReply
)

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

Public function Virtual

FReply

 

OnMotionDetected

(
    const FGeometry& MyGeometry,
    const FMotionEvent& InMotionEvent
)

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

Public function Virtual

FReply

 

OnMouseButtonDoubleClick

(
    const FGeometry& InMyGeometry,
    const FPointerEvent& InMouseEvent
)

Called when a mouse button is double clicked. Override this in derived classes.

Public function Virtual

FReply

 

OnMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

MOUSE INPUT The system calls this method to notify the widget that a mouse button was pressed within it.

Public function Virtual

FReply

 

OnMouseButtonUp

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse button was release within it.

Public function Virtual

void

 

OnMouseEnter

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system will use this event to notify a widget that the cursor has entered it.

Public function Virtual

void

 

OnMouseLeave

(
    const FPointerEvent& MouseEvent
)

The system will use this event to notify a widget that the cursor has left it.

Public function Virtual

FReply

 

OnMouseMove

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse moved within it.

Public function Virtual

FReply

 

OnMouseWheel

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Called when the mouse wheel is spun. This event is bubbled.

Public function Virtual

FNavigationReply

 

OnNavigation

(
    const FGeometry& MyGeometry,
    const FNavigationEvent& InNavigationEvent
)

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

Public function Virtual Const

int32

 

OnPaint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawElements,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children.

Public function Virtual Const

FPopupMethodReply

 

OnQueryPopupMethod()

Popups can manifest in a NEW OS WINDOW or via an OVERLAY in an existing window.

Public function Virtual Const

TOptional< bool >

 

OnQueryShowFocus

(
    const EFocusCause InFocusCause
)

Called to determine if we should render the focus brush.

Public function Virtual

FReply

 

OnTouchEnded

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is ended (finger lifted)

Public function Virtual

FReply

 

OnTouchFirstMove

(
    const FGeometry& MyGeometry,
    const FPointerEvent& TouchEvent
)

Called when a touchpad touch first moves after TouchStarted

Public function Virtual

FReply

 

OnTouchForceChanged

(
    const FGeometry& MyGeometry,
    const FPointerEvent& TouchEvent
)

Called when a touchpad touch force changes

Public function Virtual

FReply

 

OnTouchGesture

(
    const FGeometry& MyGeometry,
    const FPointerEvent& GestureEvent
)

TOUCH and GESTURES Called when the user performs a gesture on trackpad. This event is bubbled.

Public function Virtual

FReply

 

OnTouchMoved

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is moved (finger moved)

Public function Virtual

FReply

 

OnTouchStarted

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is started (finger down)

Public function Virtual Const

bool

 

SupportsKeyboardFocus()

SViewport wants keyboard focus

Public function Virtual

void

 

Tick

(
    const FGeometry& AllottedGeometry,
    const double InCurrentTime,
    const float InDeltaTime
)

Ticks this widget with Geometry.

Public function Virtual Const

TSharedPtr< struct FVirtualPointerPosition >

 

TranslateMouseCoordinateFor3DChild

(
    const TSharedRef< SWidget >& ChildWidget,
    const FGeometry& MyGeometry,
    const FVector2D& ScreenSpaceMouseCoordinate,
    const FVector2D& LastScreenSpaceMouseCoordinate
)

Classes

Name

Description

Public struct

FArguments

Deprecated Functions

Name Description

Public function

void

 

SetWidgetToFocusOnActivate

(
    TSharedPtr< SWidget > WidgetToFocus
)

SetWidgetToFocusOnActivate is no longer needed, remove this call.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback