SVirtualJoystick

A virtual joystsick

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Input/SVirtualJoystick.h

Include

#include "Widgets/Input/SVirtualJoystick.h"

Syntax

class SVirtualJoystick : public SLeafWidget

Remarks

A virtual joystsick

Variables

Name Description

Protected variable

float

 

ActivationDelay

Protected variable

float

 

ActiveOpacity

Global settings from the UTouchInterface

Protected variable

uint32: 1

 

bCenterOnEvent

If true, this zone will have it's "center" set when you touch it, otherwise the center will be set to the center of the zone

Protected variable

uint32: 1

 

bPreventReCenter

If true, ignore re-centering

Protected variable

uint32: 1

 

bVisible

True if the joystick should be visible

Protected variable

TArray< FContro...

 

Controls

List of controls set by the UTouchInterface

Protected variable

float

 

Countdown

Countdown until next state change

Protected variable

float

 

CurrentOpacity

Target opacity

Protected variable

float

 

InactiveOpacity

Protected variable

float

 

PreviousScalingFactor

Last used scaling value for

Protected variable

float

 

StartupDelay

Protected variable

EVirtualJoystic...

 

State

The current state of all controls

Protected variable

float

 

TimeUntilDeactive

Protected variable

float

 

TimeUntilReset

Functions

Name Description

Public function

void

 

AddControl

(
    const FControlInfo& Control
)

Protected function

void

 

AlignBoxIntoScreen

(
    FVector2D& Position,
    const FVector2D& Size,
    const FVector2D& ScreenSize
)

Public function

void

 

ClearControls()

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Protected function

float

 

GetBaseOpacity()

Return the target opacity to lerp to given the current state

Protected function Virtual

void

 

HandleDisplayMetricsChanged

(
    const FDisplayMetrics& NewDisplayM...
)

Callback for handling display metrics changes.

Protected function Virtual

bool

 

HandleTouch

(
    int32 ControlIndex,
    const FVector2D& LocalCoord,
    const FVector2D& ScreenSize
)

Process a touch event (on movement and possibly on initial touch)

Public function

void

 

SetControls

(
    const TArray< FControlInfo >& InCo...
)

Public function

void

 

SetGlobalParameters

(
    float InActiveOpacity,
    float InInactiveOpacity,
    float InTimeUntilDeactive,
    float InTimeUntilReset,
    float InActivationDelay,
    bool InbPreventReCenter,
    float InStartupDelay
)

Sets parameters that control all controls

Public function

void

 

SetJoystickVisibility

(
    const bool bVisible,
    const bool bFade
)

Shows or hides the controls (for instance during cinematics

Public function Static

bool

 

ShouldDisplayTouchInterface()

Static function to return if external users should create/activate/etc a touch interface Note that this function is also used internally, so even if this returns false but an SVirtualJoystick is created, it won't actually show any controls

Overridden from SWidget

Name Description

Public function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float
)

Overwritten from SWidget.

Public function Virtual Const

int32

 

OnPaint

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

Overwritten from SWidget.

Public function Virtual

FReply

 

OnTouchEnded

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is ended (finger lifted)

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()

Checks to see if this widget supports keyboard focus. Override this in derived classes.

Public function Virtual

void

 

Tick

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

Ticks this widget with Geometry.

Classes

Name

Description

Public struct

FArguments

Public struct

FControlInfo

The settings and current state of each zone we render

Enums

Name

Description

Protected enum

EVirtualJoystickState

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