Slate.TooltipIntroDuration
Slate.TooltipIntroDuration
#Overview
name: Slate.TooltipIntroDuration
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
How long it takes for a tooltip to animate into view, in seconds.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Slate.TooltipIntroDuration is to control the animation duration for tooltips in the Slate UI framework. It determines how long it takes for a tooltip to fade into view when it appears.
This setting variable is primarily used by the Slate subsystem, which is part of Unreal Engine’s UI framework. Specifically, it’s utilized in the SlateUser module, which handles user interaction with the Slate UI.
The value of this variable is set in the C++ code, initially defined as a static float with a default value of 0.1 seconds. It’s then exposed as a console variable using FAutoConsoleVariableRef, allowing it to be adjusted at runtime.
The associated variable TooltipIntroDuration interacts directly with Slate.TooltipIntroDuration. They share the same value, with TooltipIntroDuration being the actual variable used in the code, while Slate.TooltipIntroDuration is the console variable name used for runtime adjustments.
Developers should be aware that this variable affects the user experience of tooltip animations. A lower value will make tooltips appear more quickly, while a higher value will create a slower, more gradual fade-in effect.
Best practices when using this variable include:
- Keeping the value relatively low (like the default 0.1 seconds) to ensure responsive UI feedback.
- Adjusting it based on user feedback or specific design requirements.
- Using it in conjunction with other tooltip-related settings for a cohesive tooltip behavior.
Regarding the associated variable TooltipIntroDuration:
- Its purpose is the same as Slate.TooltipIntroDuration, controlling the tooltip animation duration.
- It’s used directly in the SlateUser module to calculate tooltip opacity during the animation.
- Its value is set by the console variable Slate.TooltipIntroDuration.
- It interacts with other variables like TooltipSummonDelay and ActiveTooltipInfo.SummonTime to determine the exact timing of tooltip animations.
- Developers should be aware that modifying TooltipIntroDuration directly in the code will be overridden by any runtime changes to the console variable.
- Best practices include using this variable consistently throughout the Slate framework for tooltip animations and considering its impact on performance, especially for frequently appearing tooltips.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateUser.cpp:52
Scope: file
Source code excerpt:
static float TooltipIntroDuration = 0.1f;
FAutoConsoleVariableRef CVarTooltipIntroDuration(
TEXT("Slate.TooltipIntroDuration"),
TooltipIntroDuration,
TEXT("How long it takes for a tooltip to animate into view, in seconds."));
static float CursorSignificantMoveDetectionThreshold = 0.0;
FAutoConsoleVariableRef CVarCursorSignificantMoveDetectionThreshold(
TEXT("Slate.CursorSignificantMoveDetectionThreshold"),
#Associated Variable and Callsites
This variable is associated with another variable named TooltipIntroDuration
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateUser.cpp:50
Scope: file
Source code excerpt:
TEXT("Delay in seconds before a tooltip is displayed near the mouse cursor when hovering over widgets that supply tooltip data."));
static float TooltipIntroDuration = 0.1f;
FAutoConsoleVariableRef CVarTooltipIntroDuration(
TEXT("Slate.TooltipIntroDuration"),
TooltipIntroDuration,
TEXT("How long it takes for a tooltip to animate into view, in seconds."));
static float CursorSignificantMoveDetectionThreshold = 0.0;
FAutoConsoleVariableRef CVarCursorSignificantMoveDetectionThreshold(
TEXT("Slate.CursorSignificantMoveDetectionThreshold"),
CursorSignificantMoveDetectionThreshold,
#Loc: <Workspace>/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateUser.cpp:1391
Scope (from outer to inner):
file
function void FSlateUser::UpdateTooltip
Source code excerpt:
const double PlatformSeconds = FPlatformTime::Seconds();
const float TimeSinceSummon = (float)(PlatformSeconds - TooltipSummonDelay - ActiveTooltipInfo.SummonTime);
const float TooltipOpacity = FMath::Clamp<float>(TimeSinceSummon / TooltipIntroDuration, 0.0f, 1.0f);
// Update window opacity
TSharedRef<SWindow> TooltipWindow = TooltipWindowPtr.Pin().ToSharedRef();
TooltipWindow->SetOpacity(TooltipOpacity);
// How far tool tips should slide