UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SViewport Class Reference

#include <SViewport.h>

+ Inheritance diagram for SViewport:

Public Member Functions

 SLATE_BEGIN_ARGS (SViewport)
 
 SLATE_ATTRIBUTE (FVector2D, ViewportSize)
 
SLATE_API SViewport ()
 
virtual SLATE_API ~SViewport ()
 
SLATE_API void Construct (const FArguments &InArgs)
 
virtual bool SupportsKeyboardFocus () const override
 
virtual FVector2D ComputeDesiredSize (float) const override
 
SLATE_API void SetViewportInterface (TSharedRef< ISlateViewport > InViewportInterface)
 
TWeakPtr< ISlateViewportGetViewportInterface ()
 
SLATE_API void SetContent (TSharedPtr< SWidget > InContent)
 
SLATE_API void SetCustomHitTestPath (TSharedPtr< ICustomHitTestPath > CustomHitTestPath)
 
SLATE_API TSharedPtr< ICustomHitTestPathGetCustomHitTestPath ()
 
const TSharedPtr< SWidgetGetContent () const
 
SLATE_API void OnWindowClosed (const TSharedRef< SWindow > &InWindowBeingClosed)
 
SLATE_API FReply OnViewportActivated (const FWindowActivateEvent &InActivateEvent)
 
SLATE_API void OnViewportDeactivated (const FWindowActivateEvent &InActivateEvent)
 
bool ShouldRenderDirectly () const
 
bool IsStereoRenderingAllowed () const
 
SLATE_API void SetRenderDirectlyToWindow (const bool bInRenderDirectlyToWindow)
 
SLATE_API void SetIgnoreTextureAlpha (const bool bInIgnoreTextureAlpha)
 
bool GetIgnoreTextureAlpha (void) const
 
void EnableStereoRendering (const bool bInEnableStereoRendering)
 
SLATE_API void SetActive (bool bActive)
 
virtual SLATE_API int32 OnPaint (const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override
 
virtual SLATE_API void Tick (const FGeometry &AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
 
virtual SLATE_API FReply OnTouchStarted (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent) override
 
virtual SLATE_API FReply OnTouchMoved (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent) override
 
virtual SLATE_API FReply OnTouchEnded (const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent) override
 
virtual SLATE_API FReply OnTouchForceChanged (const FGeometry &MyGeometry, const FPointerEvent &TouchEvent) override
 
virtual SLATE_API FReply OnTouchFirstMove (const FGeometry &MyGeometry, const FPointerEvent &TouchEvent) override
 
virtual SLATE_API FReply OnTouchGesture (const FGeometry &MyGeometry, const FPointerEvent &GestureEvent) override
 
virtual SLATE_API FCursorReply OnCursorQuery (const FGeometry &MyGeometry, const FPointerEvent &CursorEvent) const override
 
virtual SLATE_API TOptional< TSharedRef< SWidget > > OnMapCursor (const FCursorReply &CursorReply) const override
 
virtual SLATE_API FReply OnMouseButtonDown (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
 
virtual SLATE_API FReply OnMouseButtonUp (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
 
virtual SLATE_API void OnMouseEnter (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
 
virtual SLATE_API void OnMouseLeave (const FPointerEvent &MouseEvent) override
 
virtual SLATE_API FReply OnMouseMove (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
 
virtual SLATE_API FReply OnMouseWheel (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
 
virtual SLATE_API FReply OnMouseButtonDoubleClick (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
 
virtual SLATE_API FReply OnKeyDown (const FGeometry &MyGeometry, const FKeyEvent &KeyEvent) override
 
virtual SLATE_API FReply OnKeyUp (const FGeometry &MyGeometry, const FKeyEvent &KeyEvent) override
 
virtual SLATE_API FReply OnAnalogValueChanged (const FGeometry &MyGeometry, const FAnalogInputEvent &InAnalogInputEvent) override
 
virtual SLATE_API FReply OnKeyChar (const FGeometry &MyGeometry, const FCharacterEvent &CharacterEvent) override
 
virtual SLATE_API FReply OnFocusReceived (const FGeometry &MyGeometry, const FFocusEvent &InFocusEvent) override
 
virtual SLATE_API void OnFocusLost (const FFocusEvent &InFocusEvent) override
 
virtual SLATE_API FReply OnMotionDetected (const FGeometry &MyGeometry, const FMotionEvent &InMotionEvent) override
 
virtual SLATE_API TOptional< boolOnQueryShowFocus (const EFocusCause InFocusCause) const override
 
virtual SLATE_API FPopupMethodReply OnQueryPopupMethod () const override
 
virtual SLATE_API void OnFinishedPointerInput () override
 
virtual SLATE_API void OnArrangeChildren (const FGeometry &AllottedGeometry, FArrangedChildren &ArrangedChildren) const override
 
virtual SLATE_API TOptional< FVirtualPointerPositionTranslateMouseCoordinateForCustomHitTestChild (const SWidget &ChildWidget, const FGeometry &MyGeometry, const FVector2D ScreenSpaceMouseCoordinate, const FVector2D LastScreenSpaceMouseCoordinate) const override
 
virtual SLATE_API FNavigationReply OnNavigation (const FGeometry &MyGeometry, const FNavigationEvent &InNavigationEvent) override
 
- Public Member Functions inherited from SCompoundWidget
const FVector2D GetContentScale () const
 
void SetContentScale (TAttribute< FVector2D > InContentScale)
 
FLinearColor GetColorAndOpacity () const
 
void SetColorAndOpacity (TAttribute< FLinearColor > InColorAndOpacity)
 
void SetForegroundColor (TAttribute< FSlateColor > InForegroundColor)
 
virtual SLATECORE_API FChildrenGetChildren () override
 
virtual SLATECORE_API FSlateColor GetForegroundColor () const override
 
virtual SLATECORE_API void SetVisibility (TAttribute< EVisibility > InVisibility) override final
 
- Public Member Functions inherited from SWidget
SLATECORE_API int32 Paint (const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const
 
virtual SLATECORE_API void OnFocusChanging (const FWeakWidgetPath &PreviousFocusPath, const FWidgetPath &NewWidgetPath, const FFocusEvent &InFocusEvent)
 
virtual SLATECORE_API FReply OnPreviewKeyDown (const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent)
 
virtual SLATECORE_API FReply OnPreviewMouseButtonDown (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 
virtual SLATECORE_API bool OnVisualizeTooltip (const TSharedPtr< SWidget > &TooltipContent)
 
virtual SLATECORE_API TSharedPtr< FPopupLayerOnVisualizePopup (const TSharedRef< SWidget > &PopupContent)
 
virtual SLATECORE_API FReply OnDragDetected (const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
 
virtual SLATECORE_API void OnDragEnter (const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent)
 
virtual SLATECORE_API void OnDragLeave (const FDragDropEvent &DragDropEvent)
 
virtual SLATECORE_API FReply OnDragOver (const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent)
 
virtual SLATECORE_API FReply OnDrop (const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent)
 
virtual SLATECORE_API void OnFinishedKeyInput ()
 
virtual SLATECORE_API EWindowZone::Type GetWindowZoneOverride () const
 
bool NeedsPrepass () const
 
SLATECORE_API void SlatePrepass ()
 
SLATECORE_API void SlatePrepass (float InLayoutScaleMultiplier)
 
void SetCanTick (bool bInCanTick)
 
bool GetCanTick () const
 
bool HasRegisteredSlateAttribute () const
 
bool IsAttributesUpdatesEnabled () const
 
const FSlateWidgetPersistentStateGetPersistentState () const
 
const FWidgetProxyHandle GetProxyHandle () const
 
SLATECORE_API UE::Slate::FDeprecateVector2DResult GetDesiredSize () const
 
SLATECORE_API void AssignParentWidget (TSharedPtr< SWidget > InParent)
 
SLATECORE_API bool ConditionallyDetatchParentWidget (SWidget *InExpectedParent)
 
virtual bool ValidatePathToChild (SWidget *InChild)
 
bool IsParentValid () const
 
TSharedPtr< SWidgetGetParentWidget () const
 
TSharedPtr< SWidgetAdvanced_GetPaintParentWidget () const
 
SLATECORE_API FSlateRect CalculateCullingAndClippingRules (const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, bool &bClipToBounds, bool &bAlwaysClip, bool &bIntersectClipBounds) const
 
bool HasAnyUpdateFlags (EWidgetUpdateFlags FlagsToCheck) const
 
TStatId GetStatID (bool bForDeferredUse=false) const
 
virtual SLATECORE_API float GetRelativeLayoutScale (const int32 ChildIndex, float LayoutScaleMultiplier) const
 
SLATECORE_API void ArrangeChildren (const FGeometry &AllottedGeometry, FArrangedChildren &ArrangedChildren, bool bUpdateAttributes=false) const
 
virtual FChildrenGetAllChildren ()
 
virtual SLATECORE_API bool HasKeyboardFocus () const
 
SLATECORE_API TOptional< EFocusCauseHasUserFocus (int32 UserIndex) const
 
SLATECORE_API TOptional< EFocusCauseHasAnyUserFocus () const
 
SLATECORE_API bool HasUserFocusedDescendants (int32 UserIndex) const
 
SLATECORE_API bool HasFocusedDescendants () const
 
SLATECORE_API bool HasAnyUserFocusOrFocusedDescendants () const
 
SLATECORE_API bool HasMouseCapture () const
 
SLATECORE_API bool HasMouseCaptureByUser (int32 UserIndex, TOptional< int32 > PointerIndex=TOptional< int32 >()) const
 
virtual SLATECORE_API void OnMouseCaptureLost (const FCaptureLostEvent &CaptureLostEvent)
 
void SetEnabled (TAttribute< bool > InEnabledState)
 
bool IsEnabled () const
 
virtual bool IsInteractable () const
 
virtual SLATECORE_API TSharedPtr< IToolTipGetToolTip ()
 
virtual SLATECORE_API void OnToolTipClosing ()
 
SLATECORE_API void EnableToolTipForceField (const bool bEnableForceField)
 
bool HasToolTipForceField () const
 
bool IsHovered () const
 
SLATECORE_API bool IsDirectlyHovered () const
 
EVisibility GetVisibility () const
 
bool IsVolatile () const
 
bool IsVolatileIndirectly () const
 
void ForceVolatile (bool bForce)
 
bool ShouldInvalidatePrepassDueToVolatility ()
 
SLATECORE_API void Invalidate (EInvalidateWidgetReason InvalidateReason)
 
void CacheVolatility ()
 
void MarkPrepassAsDirty ()
 
float GetRenderOpacity () const
 
void SetRenderOpacity (float InRenderOpacity)
 
void SetTag (FName InTag)
 
const TOptional< FSlateRenderTransform > & GetRenderTransform () const
 
TOptional< FSlateRenderTransformGetRenderTransformWithRespectToFlowDirection () const
 
UE::Slate::FDeprecateVector2DResult GetRenderTransformPivotWithRespectToFlowDirection () const
 
void SetRenderTransform (TAttribute< TOptional< FSlateRenderTransform > > InTransform)
 
UE::Slate::FDeprecateVector2DResult GetRenderTransformPivot () const
 
void SetRenderTransformPivot (TAttribute< FVector2D > InTransformPivot)
 
SLATECORE_API void SetClipping (EWidgetClipping InClipping)
 
EWidgetClipping GetClipping () const
 
SLATECORE_API void SetPixelSnapping (EWidgetPixelSnapping InPixelSnappingMethod)
 
EWidgetPixelSnapping GetPixelSnapping () const
 
void SetCullingBoundsExtension (const FMargin &InCullingBoundsExtension)
 
FMargin GetCullingBoundsExtension () const
 
void SetFlowDirectionPreference (EFlowDirectionPreference InFlowDirectionPreference)
 
EFlowDirectionPreference GetFlowDirectionPreference () const
 
SLATECORE_API void SetToolTipText (const TAttribute< FText > &ToolTipText)
 
SLATECORE_API void SetToolTipText (const FText &InToolTipText)
 
SLATECORE_API void SetToolTip (const TAttribute< TSharedPtr< IToolTip > > &InToolTip)
 
SLATECORE_API void SetCursor (const TAttribute< TOptional< EMouseCursor::Type > > &InCursor)
 
template<typename MetaDataType >
TSharedPtr< MetaDataType > GetMetaData () const
 
template<typename MetaDataType >
TArray< TSharedRef< MetaDataType > > GetAllMetaData () const
 
template<typename MetaDataType >
void AddMetadata (const TSharedRef< MetaDataType > &AddMe)
 
template<typename MetaDataType >
int32 RemoveMetaData (const TSharedRef< MetaDataType > &RemoveMe)
 
SLATECORE_API void SetOnMouseButtonDown (FPointerEventHandler EventHandler)
 
SLATECORE_API void SetOnMouseButtonUp (FPointerEventHandler EventHandler)
 
SLATECORE_API void SetOnMouseMove (FPointerEventHandler EventHandler)
 
SLATECORE_API void SetOnMouseDoubleClick (FPointerEventHandler EventHandler)
 
SLATECORE_API void SetOnMouseEnter (FNoReplyPointerEventHandler EventHandler)
 
SLATECORE_API void SetOnMouseLeave (FSimpleNoReplyPointerEventHandler EventHandler)
 
virtual SLATECORE_API FString ToString () const
 
SLATECORE_API FString GetTypeAsString () const
 
SLATECORE_API FName GetType () const
 
virtual SLATECORE_API FString GetReadableLocation () const
 
SLATECORE_API FName GetCreatedInLocation () const
 
virtual SLATECORE_API FName GetTag () const
 
virtual SLATECORE_API FSlateColor GetDisabledForegroundColor () const
 
SLATECORE_API const FGeometryGetCachedGeometry () const
 
SLATECORE_API const FGeometryGetTickSpaceGeometry () const
 
SLATECORE_API const FGeometryGetPaintSpaceGeometry () const
 
const TOptional< FSlateClippingState > & GetCurrentClippingState () const
 
virtual bool Advanced_IsWindow () const
 
virtual bool Advanced_IsInvalidationRoot () const
 
virtual const FSlateInvalidationRootAdvanced_AsInvalidationRoot () const
 
SLATECORE_API TSharedRef< FActiveTimerHandleRegisterActiveTimer (float TickPeriod, FWidgetActiveTimerDelegate TickFunction)
 
SLATECORE_API void UnRegisterActiveTimer (const TSharedRef< FActiveTimerHandle > &ActiveTimerHandle)
 
bool HasActiveTimers () const
 
- Public Member Functions inherited from FSlateControlledConstruction
 FSlateControlledConstruction ()=default
 
virtual ~FSlateControlledConstruction ()=default
 
virtual const FSlateWidgetClassDataGetWidgetClass () const =0
 
void operator delete (void *mem)
 
- Public Member Functions inherited from TSharedFromThis< SWidget >
TSharedRef< SWidget, Mode > AsShared ()
 
TSharedRef< SWidget const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< SWidget, Mode > AsWeak ()
 
TWeakPtr< SWidget const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Static Public Member Functions

static SLATE_API UE::Slate::FDeprecateVector2DResult GetDefaultViewportSize ()
 
- Static Public Member Functions inherited from FSlateControlledConstruction
static const FSlateWidgetClassDataStaticWidgetClass ()
 

Protected Member Functions

SLATE_API EActiveTimerReturnType EnsureTick (double InCurrentTime, float InDeltaTime)
 
- Protected Member Functions inherited from SCompoundWidget
TSlateAttributeRef< FVector2DGetContentScaleAttribute () const
 
TSlateAttributeRef< FLinearColorGetColorAndOpacityAttribute () const
 
TSlateAttributeRef< FSlateColorGetForegroundColorAttribute () const
 
SLATECORE_API SCompoundWidget ()
 
virtual SLATECORE_API ~SCompoundWidget ()
 
- Protected Member Functions inherited from SWidget
void SetVolatilePrepass (bool bVolatile)
 
virtual bool CustomPrepass (float LayoutScaleMultiplier)
 
virtual SLATECORE_API void CacheDesiredSize (float InLayoutScaleMultiplier)
 
void SetHover (TAttribute< bool > InHovered)
 
bool IsChildWidgetCulled (const FSlateRect &, const FArrangedWidget &) const
 
SLATECORE_API void InvalidateChildRemovedFromTree (SWidget &Child)
 
bool Advanced_InvalidateVolatility ()
 
EFlowDirection ComputeFlowDirection () const
 
SLATECORE_API void SetDebugInfo (const ANSICHAR *InType, const ANSICHAR *InFile, int32 OnLine, size_t InAllocSize)
 
virtual SLATECORE_API TOptional< EMouseCursor::TypeGetCursor () const
 
SLATECORE_API SWidget ()
 
SLATECORE_API void SWidgetConstruct (const FSlateBaseNamedArgs &Args)
 
bool IsConstructed () const
 
SLATECORE_API bool FindChildGeometries (const FGeometry &MyGeometry, const TSet< TSharedRef< SWidget > > &WidgetsToFind, TMap< TSharedRef< SWidget >, FArrangedWidget > &OutResult) const
 
SLATECORE_API void FindChildGeometries_Helper (const FGeometry &MyGeometry, const TSet< TSharedRef< SWidget > > &WidgetsToFind, TMap< TSharedRef< SWidget >, FArrangedWidget > &OutResult) const
 
SLATECORE_API FGeometry FindChildGeometry (const FGeometry &MyGeometry, TSharedRef< SWidget > WidgetToFind) const
 
bool ShouldBeEnabled (bool InParentEnabled) const
 
virtual bool ComputeVolatility () const
 
virtual SLATECORE_API void OnClippingChanged ()
 
float GetPrepassLayoutScaleMultiplier () const
 
SLATECORE_API void Prepass_ChildLoop (float InLayoutScaleMultiplier, FChildren *MyChildren)
 
template<typename TargetValueType , typename SourceValueType >
bool SetAttribute (TAttribute< TargetValueType > &TargetValue, const TAttribute< SourceValueType > &SourceValue, EInvalidateWidgetReason BaseInvalidationReason)
 
TSlateAttributeRef< boolGetEnabledStateAttribute () const
 
TSlateAttributeRef< boolGetHoveredAttribute () const
 
TSlateAttributeRef< EVisibilityGetVisibilityAttribute () const
 
TSlateAttributeRef< TOptional< FSlateRenderTransform > > GetRenderTransformAttribute () const
 
TSlateAttributeRef< FVector2DGetRenderTransformPivotAttribute () const
 
virtual SLATECORE_API ~SWidget ()
 
- Protected Member Functions inherited from TSharedFromThis< SWidget >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Protected Attributes

TWeakPtr< ISlateViewportViewportInterface
 
- Protected Attributes inherited from SCompoundWidget
FCompoundWidgetOneChildSlot ChildSlot
 
- Protected Attributes inherited from SWidget
uint8 bCanSupportFocus: 1
 
uint8 bCanHaveChildren: 1
 
uint8 bClippingProxy: 1
 
uint8 bHasCustomPrepass: 1
 
uint8 bHasRelativeLayoutScale: 1
 
uint8 bVolatilityAlwaysInvalidatesPrepass: 1
 
EWidgetClipping Clipping
 
EWidgetPixelSnapping PixelSnappingMethod
 
FMargin CullingBoundsExtension
 
float RenderOpacity
 

Additional Inherited Members

- Static Protected Member Functions inherited from SWidget
static SLATECORE_API int32 FindChildUnderMouse (const FArrangedChildren &Children, const FPointerEvent &MouseEvent)
 
static SLATECORE_API int32 FindChildUnderPosition (const FArrangedChildren &Children, const UE::Slate::FDeprecateVector2DParameter &ArrangedSpacePosition)
 
static TAttribute< EVisibilityAccessWidgetVisibilityAttribute (const TSharedRef< SWidget > &Widget)
 
- Static Protected Member Functions inherited from TSharedFromThis< SWidget >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Constructor & Destructor Documentation

◆ SViewport()

SViewport::SViewport ( )

Default constructor.

◆ ~SViewport()

SViewport::~SViewport ( )
virtualdefault

Member Function Documentation

◆ ComputeDesiredSize()

virtual FVector2D SViewport::ComputeDesiredSize ( float  ) const
inlineoverridevirtual

Computes the ideal size necessary to display this widget.

Returns
The desired width and height.

Reimplemented from SCompoundWidget.

◆ Construct()

void SViewport::Construct ( const FArguments &  InArgs)

Construct the widget.

Parameters
InArgsDeclaration from which to construct the widget.

◆ EnableStereoRendering()

void SViewport::EnableStereoRendering ( const bool  bInEnableStereoRendering)
inline

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

Parameters
bInEnableStereoRenderingWhether stereo rendering should be allowed for this viewport

◆ EnsureTick()

EActiveTimerReturnType SViewport::EnsureTick ( double  InCurrentTime,
float  InDeltaTime 
)
protected

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

◆ GetContent()

const TSharedPtr< SWidget > SViewport::GetContent ( ) const
inline

◆ GetCustomHitTestPath()

TSharedPtr< ICustomHitTestPath > SViewport::GetCustomHitTestPath ( )

◆ GetDefaultViewportSize()

static SLATE_API UE::Slate::FDeprecateVector2DResult SViewport::GetDefaultViewportSize ( )
static

◆ GetIgnoreTextureAlpha()

bool SViewport::GetIgnoreTextureAlpha ( void  ) const
inline
Returns
Whether or not to ignore texture alpha when blending

◆ GetViewportInterface()

TWeakPtr< ISlateViewport > SViewport::GetViewportInterface ( )
inline

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

Parameters
InViewportInterfaceThe interface to use

◆ IsStereoRenderingAllowed()

bool SViewport::IsStereoRenderingAllowed ( ) const
inline
Returns
Whether or not this viewport supports stereo rendering

◆ OnAnalogValueChanged()

FReply SViewport::OnAnalogValueChanged ( const FGeometry MyGeometry,
const FAnalogInputEvent InAnalogInputEvent 
)
overridevirtual

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 from SWidget.

◆ OnArrangeChildren()

void SViewport::OnArrangeChildren ( const FGeometry AllottedGeometry,
FArrangedChildren ArrangedChildren 
) const
overridevirtual

Compute the Geometry of all the children and add populate the ArrangedChildren list with their values. Each type of Layout panel should arrange children based on desired behavior.

Parameters
AllottedGeometryThe geometry allotted for this widget by its parent.
ArrangedChildrenThe array to which to add the WidgetGeometries that represent the arranged children.

Reimplemented from SCompoundWidget.

◆ OnCursorQuery()

FCursorReply SViewport::OnCursorQuery ( const FGeometry MyGeometry,
const FPointerEvent CursorEvent 
) const
overridevirtual

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

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

Reimplemented from SWidget.

◆ OnFinishedPointerInput()

void SViewport::OnFinishedPointerInput ( )
overridevirtual

All the pointer (mouse, touch, stylus, etc.) events from this frame have been routed. This is a widget's chance to act on any accumulated data.

Reimplemented from SWidget.

◆ OnFocusLost()

void SViewport::OnFocusLost ( const FFocusEvent InFocusEvent)
overridevirtual

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

Parameters
InFocusEventThe FocusEvent

Reimplemented from SWidget.

◆ OnFocusReceived()

FReply SViewport::OnFocusReceived ( const FGeometry MyGeometry,
const FFocusEvent InFocusEvent 
)
overridevirtual

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

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

Reimplemented from SWidget.

◆ OnKeyChar()

FReply SViewport::OnKeyChar ( const FGeometry MyGeometry,
const FCharacterEvent InCharacterEvent 
)
overridevirtual

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

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

Reimplemented from SWidget.

◆ OnKeyDown()

FReply SViewport::OnKeyDown ( const FGeometry MyGeometry,
const FKeyEvent InKeyEvent 
)
overridevirtual

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

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

Reimplemented from SWidget.

◆ OnKeyUp()

FReply SViewport::OnKeyUp ( const FGeometry MyGeometry,
const FKeyEvent InKeyEvent 
)
overridevirtual

Called after a key is released when this widget has focus

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

Reimplemented from SWidget.

◆ OnMapCursor()

TOptional< TSharedRef< SWidget > > SViewport::OnMapCursor ( const FCursorReply CursorReply) const
overridevirtual

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 from SWidget.

◆ OnMotionDetected()

FReply SViewport::OnMotionDetected ( const FGeometry MyGeometry,
const FMotionEvent InMotionEvent 
)
overridevirtual

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

Parameters
InMotionEventThe motion event generated

Reimplemented from SWidget.

◆ OnMouseButtonDoubleClick()

FReply SViewport::OnMouseButtonDoubleClick ( const FGeometry InMyGeometry,
const FPointerEvent InMouseEvent 
)
overridevirtual

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

Parameters
InMyGeometryWidget geometry
InMouseEventMouse button event
Returns
Returns whether the event was handled, along with other possible actions

Reimplemented from SWidget.

◆ OnMouseButtonDown()

FReply SViewport::OnMouseButtonDown ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
overridevirtual

The system calls this method to notify the widget that a mouse button was pressed within it. This event is bubbled.

Parameters
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented from SWidget.

◆ OnMouseButtonUp()

FReply SViewport::OnMouseButtonUp ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
overridevirtual

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

Parameters
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented from SWidget.

◆ OnMouseEnter()

void SViewport::OnMouseEnter ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
overridevirtual

The system will use this event to notify a widget that the cursor has entered it. This event is uses a custom bubble strategy.

Parameters
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event

Reimplemented from SWidget.

◆ OnMouseLeave()

void SViewport::OnMouseLeave ( const FPointerEvent MouseEvent)
overridevirtual

The system will use this event to notify a widget that the cursor has left it. This event is uses a custom bubble strategy.

Parameters
MouseEventInformation about the input event

Reimplemented from SWidget.

◆ OnMouseMove()

FReply SViewport::OnMouseMove ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
overridevirtual

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

Parameters
MyGeometryThe Geometry of the widget receiving the event
MouseEventInformation about the input event
Returns
Whether the event was handled along with possible requests for the system to take action.

Reimplemented from SWidget.

◆ OnMouseWheel()

FReply SViewport::OnMouseWheel ( const FGeometry MyGeometry,
const FPointerEvent MouseEvent 
)
overridevirtual

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

Parameters
MouseEventMouse event
Returns
Returns whether the event was handled, along with other possible actions

Reimplemented from SWidget.

◆ OnNavigation()

FNavigationReply SViewport::OnNavigation ( const FGeometry MyGeometry,
const FNavigationEvent InNavigationEvent 
)
overridevirtual

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

Parameters
InNavigationEventThe navigation event generated

Reimplemented from SWidget.

◆ OnPaint()

int32 SViewport::OnPaint ( const FPaintArgs Args,
const FGeometry AllottedGeometry,
const FSlateRect MyCullingRect,
FSlateWindowElementList OutDrawElements,
int32  LayerId,
const FWidgetStyle InWidgetStyle,
bool  bParentEnabled 
) const
overridevirtual

The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children. Called by the non-virtual OnPaint to enforce pre/post conditions during OnPaint.

Parameters
ArgsAll the arguments necessary to paint this widget (
AllottedGeometryThe FGeometry that describes an area in which the widget should appear.
MyCullingRectThe rectangle representing the bounds currently being used to completely cull widgets. Unless IsChildWidgetCulled(...) returns true, you should paint the widget.
OutDrawElementsA list of FDrawElements to populate with the output.
LayerIdThe Layer onto which this widget should be rendered.
InColorAndOpacityColor and Opacity to be applied to all the descendants of the widget being painted
bParentEnabledTrue if the parent of this widget is enabled.
Returns
The maximum layer ID attained by this widget or any of its children.

Reimplemented from SCompoundWidget.

◆ OnQueryPopupMethod()

FPopupMethodReply SViewport::OnQueryPopupMethod ( ) const
overridevirtual

Popups can manifest in a NEW OS WINDOW or via an OVERLAY in an existing window. This can be set explicitly on SMenuAnchor, or can be determined by a scoping widget. A scoping widget can reply to OnQueryPopupMethod() to drive all its descendants' poup methods.

e.g. Fullscreen games cannot summon a new window, so game SViewports will reply with EPopupMethod::UserCurrentWindow. This makes all the menu anchors within them use the current window.

Reimplemented from SWidget.

◆ OnQueryShowFocus()

TOptional< bool > SViewport::OnQueryShowFocus ( const EFocusCause  InFocusCause) const
overridevirtual

Called to determine if we should render the focus brush.

Parameters
InFocusCauseThe cause of focus

Reimplemented from SWidget.

◆ OnTouchEnded()

FReply SViewport::OnTouchEnded ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
overridevirtual

Called when a touchpad touch is ended (finger lifted)

Parameters
InTouchEventThe touch event generated

Reimplemented from SWidget.

◆ OnTouchFirstMove()

FReply SViewport::OnTouchFirstMove ( const FGeometry MyGeometry,
const FPointerEvent TouchEvent 
)
overridevirtual

Called when a touchpad touch first moves after TouchStarted

Parameters
InTouchEventThe touch event generated

Reimplemented from SWidget.

◆ OnTouchForceChanged()

FReply SViewport::OnTouchForceChanged ( const FGeometry MyGeometry,
const FPointerEvent TouchEvent 
)
overridevirtual

Called when a touchpad touch force changes

Parameters
InTouchEventThe touch event generated

Reimplemented from SWidget.

◆ OnTouchGesture()

FReply SViewport::OnTouchGesture ( const FGeometry MyGeometry,
const FPointerEvent GestureEvent 
)
overridevirtual

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

Parameters
GestureEventgesture event
Returns
Returns whether the event was handled, along with other possible actions

Reimplemented from SWidget.

◆ OnTouchMoved()

FReply SViewport::OnTouchMoved ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
overridevirtual

Called when a touchpad touch is moved (finger moved)

Parameters
InTouchEventThe touch event generated

Reimplemented from SWidget.

◆ OnTouchStarted()

FReply SViewport::OnTouchStarted ( const FGeometry MyGeometry,
const FPointerEvent InTouchEvent 
)
overridevirtual

Called when a touchpad touch is started (finger down)

Parameters
InTouchEventThe touch event generated

Reimplemented from SWidget.

◆ OnViewportActivated()

FReply SViewport::OnViewportActivated ( const FWindowActivateEvent InActivateEvent)

A delegate called when the viewports top level window is activated

◆ OnViewportDeactivated()

void SViewport::OnViewportDeactivated ( const FWindowActivateEvent InActivateEvent)

A delegate called when the viewports top level window is deactivated

◆ OnWindowClosed()

void SViewport::OnWindowClosed ( const TSharedRef< SWindow > &  InWindowBeingClosed)

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

Parameters
InWindowBeingClosedThe window that is about to be closed

◆ SetActive()

void SViewport::SetActive ( bool  bActive)

Sets whether this viewport is active. While active, a persistent Active Timer is registered and a Slate tick/paint pass is guaranteed every frame.

Parameters
bActiveWhether to set the viewport as active

◆ SetContent()

void SViewport::SetContent ( TSharedPtr< SWidget InContent)

Sets the content for this widget

Parameters
InContentThe new content (can be null)

◆ SetCustomHitTestPath()

void SViewport::SetCustomHitTestPath ( TSharedPtr< ICustomHitTestPath CustomHitTestPath)

◆ SetIgnoreTextureAlpha()

void SViewport::SetIgnoreTextureAlpha ( const bool  bInIgnoreTextureAlpha)

If true, the viewport's texture alpha is ignored when performing blending. In this case only the viewport tint opacity is used If false, the texture alpha is used during blending

Parameters
bIgnoreTextureAlphaIf texture alpha should be ignored when blending.

◆ SetRenderDirectlyToWindow()

void SViewport::SetRenderDirectlyToWindow ( const bool  bInRenderDirectlyToWindow)

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

Parameters
bInRenderDirectlyToWindowWhether we should be able to render to the back buffer

◆ SetViewportInterface()

void SViewport::SetViewportInterface ( TSharedRef< ISlateViewport InViewportInterface)

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

Parameters
InViewportInterfaceThe interface to use

◆ ShouldRenderDirectly()

bool SViewport::ShouldRenderDirectly ( ) const
inline
Returns
Whether or not this viewport renders directly to the backbuffer

◆ SLATE_ATTRIBUTE()

SViewport::SLATE_ATTRIBUTE ( FVector2D  ,
ViewportSize   
)

Whether or not to show the disabled effect when this viewport is disabled Whether or not to render directly to the window's backbuffer or an offscreen render target that is applied to the window later Rendering to an offscreen target is the most common option in the editor where there may be many frames which this viewport's interface may wish to not re-render but use a cached buffer instead Rendering directly to the backbuffer is the most common option in the game where you want to update each frame without the cost of writing to an intermediate target first. Whether or not to enable gamma correction. Doesn't apply when rendering directly to a backbuffer. Whether or not to reverse the gamma correction done to the texture in this viewport. Ignores the bEnableGammaCorrection setting Allow this viewport to blend with its background. Whether or not to enable stereo rendering. True if the viewport texture has pre-multiplied alpha If true, the viewport's texture alpha is ignored when performing blending. In this case only the viewport tint opacity is used If false, the texture alpha is used during blending The interface to be used by this viewport for rendering and I/O. Size of the viewport widget.

◆ SLATE_BEGIN_ARGS()

SViewport::SLATE_BEGIN_ARGS ( SViewport  )
inline

◆ SupportsKeyboardFocus()

virtual bool SViewport::SupportsKeyboardFocus ( ) const
inlineoverridevirtual

SViewport wants keyboard focus

Reimplemented from SWidget.

◆ Tick()

void SViewport::Tick ( const FGeometry AllottedGeometry,
const double  InCurrentTime,
const float  InDeltaTime 
)
overridevirtual

Ticks this widget with Geometry. Override in derived classes, but always call the parent implementation.

Parameters
AllottedGeometryThe space allotted for this widget
InCurrentTimeCurrent absolute real time
InDeltaTimeReal time passed since last tick

Reimplemented from SWidget.

◆ TranslateMouseCoordinateForCustomHitTestChild()

TOptional< FVirtualPointerPosition > SViewport::TranslateMouseCoordinateForCustomHitTestChild ( const SWidget ChildWidget,
const FGeometry MyGeometry,
const FVector2D  ScreenSpaceMouseCoordinate,
const FVector2D  LastScreenSpaceMouseCoordinate 
) const
overridevirtual

Reimplemented from SWidget.

Member Data Documentation

◆ ViewportInterface

TWeakPtr<ISlateViewport> SViewport::ViewportInterface
protected

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


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