Slate.GlobalScrollAmount

Slate.GlobalScrollAmount

#Overview

name: Slate.GlobalScrollAmount

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Slate.GlobalScrollAmount is to control the amount of scrolling that occurs for each click of the mouse wheel in Slate UI components. This setting is measured in Slate Screen Units.

This setting variable is primarily used by the Slate UI system, which is a core part of Unreal Engine’s user interface framework. Based on the callsites, it’s clear that this variable is defined in the SlateCore module.

The value of this variable is set as a console variable with a default value of 32.0f. It can be modified at runtime through console commands or programmatically.

The associated variable GlobalScrollAmount is directly linked to Slate.GlobalScrollAmount. They share the same value and purpose.

Developers should be aware that this variable affects the scrolling behavior across the entire Slate UI system. Modifying this value will change the scrolling speed for all Slate-based scrollable areas in the engine and game UI.

Best practices when using this variable include:

  1. Consider the impact on user experience before modifying the default value.
  2. If changing the value, ensure it’s appropriate for your specific UI design and target platforms.
  3. Test scrolling behavior thoroughly after any modifications to ensure a smooth user experience.
  4. Use the GetGlobalScrollAmount() function to retrieve the current value when needed in code, as it ensures thread-safe access.

Regarding the associated variable GlobalScrollAmount:

The purpose of GlobalScrollAmount is the same as Slate.GlobalScrollAmount - to define the scroll amount for mouse wheel interactions in Slate UI.

It’s defined as a TAutoConsoleVariable in the SlateCore module, making it accessible and modifiable through the console system.

The value is set in the same location as Slate.GlobalScrollAmount, with a default of 32.0f.

This variable directly interacts with Slate.GlobalScrollAmount as they are essentially the same variable.

Developers should be aware that GlobalScrollAmount is the actual variable used in the codebase, while Slate.GlobalScrollAmount is the console-accessible name.

Best practices for GlobalScrollAmount are the same as for Slate.GlobalScrollAmount. Additionally, when referencing this variable in C++ code, use the GetGlobalScrollAmount() function provided in SlateConstants.h to ensure thread-safe access to the current value.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/SlateCore/Private/SlateCoreClasses.cpp:14

Scope: file

Source code excerpt:

/** How much to scroll for each click of the mouse wheel (in Slate Screen Units). */
TAutoConsoleVariable<float> GlobalScrollAmount(
	TEXT("Slate.GlobalScrollAmount"),
	32.0f,
	TEXT("How much to scroll for each click of the mouse wheel (in Slate Screen Units)."));


float GSlateContrast = 1;

#Associated Variable and Callsites

This variable is associated with another variable named GlobalScrollAmount. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/SlateCore/Private/SlateCoreClasses.cpp:13

Scope: file

Source code excerpt:


/** How much to scroll for each click of the mouse wheel (in Slate Screen Units). */
TAutoConsoleVariable<float> GlobalScrollAmount(
	TEXT("Slate.GlobalScrollAmount"),
	32.0f,
	TEXT("How much to scroll for each click of the mouse wheel (in Slate Screen Units)."));


float GSlateContrast = 1;

#Loc: <Workspace>/Engine/Source/Runtime/SlateCore/Public/Types/SlateConstants.h:6

Scope: file

Source code excerpt:


/** How much to scroll for each click of the mouse wheel (in Slate Screen Units). */
extern SLATECORE_API TAutoConsoleVariable<float> GlobalScrollAmount;
inline float GetGlobalScrollAmount() { return GlobalScrollAmount.GetValueOnAnyThread(); }

/**  */
extern SLATECORE_API float GSlateContrast;