FViewportClient

An abstract interface to a viewport's client.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/UnrealClient.h

Include

#include "UnrealClient.h"

Syntax

class FViewportClient

Remarks

An abstract interface to a viewport's client. The viewport's client processes input received by the viewport, and draws the viewport.

Destructors

Name Description

Public function Virtual

~FViewportClient()

Functions

Name Description

Public function Virtual

void

 

Activated

(
    FViewport* Viewport,
    const FWindowActivateEvent& InActi...
)

Public function Virtual

void

 

CapturedMouseMove

(
    FViewport* InViewport,
    int32 InMouseX,
    int32 InMouseY
)

Called when the mouse is moved while a window input capture is in effect

Public function Virtual

EMouseCaptur...

 

CaptureMouseOnClick()

Gets the mouse capture behavior when the viewport is clicked

Public function Virtual

bool

 

CaptureMouseOnLaunch()

Gets whether or not the viewport captures the Mouse on launch of the application Technically this controls capture on the first window activate, so in situations where the application is launched but isn't activated the effect is delayed until activation.

Public function Virtual

void

 

CloseRequested

(
    FViewport* Viewport
)

Public function Virtual

void

 

ConditionalRestoreWorld

(
    UWorld* InWorld
)

Restores GWorld to InWorld

Public function Virtual

UWorld *

 

ConditionalSetWorld()

Sets GWorld to the appropriate world for this client

Public function Virtual

void

 

Deactivated

(
    FViewport* Viewport,
    const FWindowActivateEvent& InActi...
)

Public function Virtual

void

 

Draw

(
    FViewport* Viewport,
    FCanvas* Canvas
)

Public function Virtual

EMouseCursor...

 

GetCursor

(
    FViewport* Viewport,
    int32 X,
    int32 Y
)

Retrieves the cursor that should be displayed by the OS

Public function Virtual Const

float

 

GetDPIScale()

Public function Virtual Const

const TArray...

 

GetEnabledStats()

Get a ptr to the enabled stats list

Public function Virtual

FEngineShowF...

 

GetEngineShowFlags()

Public function Virtual Const

FStatHitches...

 

GetStatHitchesData()

Get a ptr to the stat unit data for this viewport

Public function Virtual Const

FStatUnitDat...

 

GetStatUnitData()

Get a ptr to the stat unit data for this viewport

Public function Virtual Const

UWorld *

 

GetWorld()

Public function Virtual

bool

 

HandleNavigation

(
    const uint32 InUserIndex,
    TSharedPtr< SWidget > InDestination
)

Optionally do custom handling of a navigation.

Public function Virtual

bool

 

HideCursorDuringCapture()

Gets whether or not the cursor is hidden when the viewport captures the mouse

Public function Virtual

bool

 

IgnoreInput()

Check whether we should ignore input.

Public function Virtual

bool

 

InputAxis

(
    FViewport* Viewport,
    int32 ControllerId,
    FKey Key,
    float Delta,
    float DeltaTime,
    int32 NumSamples,
    bool bGamepad
)

Check an axis movement received by the viewport.

Public function Virtual

bool

 

InputChar

(
    FViewport* Viewport,
    int32 ControllerId,
    TCHAR Character
)

Check a character input received by the viewport.

Public function Virtual

bool

 

InputGesture

(
    FViewport* Viewport,
    EGestureEvent GestureType,
    const FVector2D& GestureDelta,
    bool bIsDirectionInvertedFromDevice
)

Check a gesture event received by the viewport.

Public function Virtual

bool

 

InputKey

(
    const FInputKeyEventArgs& EventArg...
)

Check a key event received by the viewport.

Public function Virtual

bool

 

InputMotion

(
    FViewport* Viewport,
    int32 ControllerId,
    const FVector& Tilt,
    const FVector& RotationRate,
    const FVector& Gravity,
    const FVector& Acceleration
)

Each frame, the input system will update the motion data.

Public function Virtual

bool

 

InputTouch

(
    FViewport* Viewport,
    int32 ControllerId,
    uint32 Handle,
    ETouchType::Type Type,
    const FVector2D& TouchLocation,
    float Force,
    FDateTime DeviceTimestamp,
    uint32 TouchpadIndex
)

Check a key event received by the viewport.

Public function Virtual

bool

 

IsFocused

(
    FViewport* Viewport
)

Public function Virtual Const

bool

 

IsInGameView()

Returns true if this viewport is excluding non-game elements from its display

Public function Virtual

bool

 

IsInPermanentCapture()

Public function Virtual Const

bool

 

IsOrtho()

Returns true if this viewport is orthogonal.

Public function Virtual Const

bool

 

IsStatEnabled

(
    const FString& InName
)

Check whether a specific stat is enabled for this viewport

Public function Virtual

bool

 

LockDuringCapture()

Gets whether or not the cursor is locked to the viewport when the viewport captures the mouse

Public function Virtual

void

 

LostFocus

(
    FViewport* Viewport
)

Public function Virtual

TOptional< T...

 

MapCursor

(
    FViewport* Viewport,
    const FCursorReply& CursorReply
)

Called to map a cursor reply to an actual widget to render.

Public function Virtual

void

 

MouseEnter

(
    FViewport* Viewport,
    int32 x,
    int32 y
)

Public function Virtual

void

 

MouseLeave

(
    FViewport* Viewport
)

Public function Virtual

void

 

MouseMove

(
    FViewport* Viewport,
    int32 X,
    int32 Y
)

Public function Virtual Const

FPopupMethod...

 

OnQueryPopupMethod()

Should we make new windows for popups or create an overlay in the current window.

Public function Virtual

bool

 

OverrideHighResScreenshotCaptureRegion

(
    FIntRect& OutCaptureRegion
)

Allow viewport client to override the current capture region

Public function Virtual

void

 

Precache()

Public function Virtual

void

 

ProcessAccumulatedPointerInput

(
    FViewport* InViewport
)

Called from slate when input is finished for this frame, and we should process any queued mouse moves.

Public function Virtual

bool

 

ProcessScreenShots

(
    FViewport* Viewport
)

Public function Virtual Const

TOptional< b...

 

QueryShowFocus

(
    const EFocusCause InFocusCause
)

Called to determine if we should render the focus brush.

Public function Virtual

void

 

ReceivedFocus

(
    FViewport* Viewport
)

Public function Virtual

void

 

RedrawRequested

(
    FViewport* Viewport
)

Public function Virtual

void

 

RequestInvalidateHitProxy

(
    FViewport* Viewport
)

Public function Virtual

bool

 

RequiresHitProxyStorage()

Public function Virtual Const

bool

 

RequiresKeyboardInput()

Determine if the viewport client is going to need any keyboard input

Public function Virtual Const

bool

 

RequiresUncapturedAxisInput()

Determines whether this viewport client should receive calls to InputAxis() if the game's window is not currently capturing the mouse.

Public function Virtual

void

 

SetEnabledStats

(
    const TArray< FString >& InEnabled...
)

Sets all the stats that should be enabled for the viewport

Public function Virtual

void

 

SetIsSimulateInEditorViewport

(
    bool bInIsSimulateInEditorViewport
)

Public function Virtual

void

 

SetShowStats

(
    bool bWantStats
)

Sets whether stats should be visible for the viewport

Public function Virtual

bool

 

ShouldAlwaysLockMouse()

Gets whether or not the cursor should always be locked to the viewport.

Public function Virtual Const

bool

 

ShouldDPIScaleSceneCanvas()

Public function Virtual Const

bool

 

WantsPollingMouseMovement()

Public function Virtual

bool

 

WindowCloseRequested()

Called when the top level window associated with the viewport has been requested to close.

Deprecated Functions

Name Description

Public function Virtual

bool

 

InputKey

(
    FViewport* Viewport,
    int32 ControllerId,
    FKey Key,
    EInputEvent Event,
    float AmountDepressed,
    bool bGamepad
)

Use the new InputKey(const FInputKeyEventArgs& EventArgs) function.

Public function

bool

 

InputTouch

(
    FViewport* Viewport,
    int32 ControllerId,
    uint32 Handle,
    ETouchType::Type Type,
    const FVector2D& TouchLocation,
    FDateTime DeviceTimestamp,
    uint32 TouchpadIndex
)

InputTouch now takes a Force

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