ShowMouseControlLabel
ShowMouseControlLabel
#Overview
name: ShowMouseControlLabel
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowMouseControlLabel is to control the visibility of a label indicating mouse control gestures in the Play-in-Editor (PIE) view of the Unreal Engine 5 editor.
This setting variable is primarily used by the Level Editor subsystem, specifically within the SLevelViewport class, which is responsible for managing the viewport display during Play-in-Editor sessions.
The value of this variable is set in the LevelEditorPlaySettings class, which is defined in the UnrealEd module. It is a boolean property that can be configured through the editor’s settings interface.
ShowMouseControlLabel interacts with other variables, notably:
- GameGetsMouseControl: Determines if the game receives mouse control during PIE.
- MouseControlLabelPosition: Specifies the screen location where the mouse control label should be anchored.
Developers should be aware that:
- This setting only takes effect when not using stereoscopic 3D rendering.
- It’s part of a larger set of Play-in-Editor settings that can be adjusted to customize the PIE experience.
Best practices when using this variable include:
- Consider the target audience of your project. If it’s mainly for developers or testers, showing the label might be helpful. For final builds or demos, it’s usually better to hide it.
- Use in conjunction with the MouseControlLabelPosition to ensure the label is displayed in an appropriate location that doesn’t interfere with gameplay or UI elements.
- Be mindful of performance implications. While minor, displaying additional UI elements can have a small impact on rendering performance.
- Remember to disable this setting when capturing footage or screenshots for promotional materials, unless the control label is intentionally part of the showcase.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:230, section: [/Script/UnrealEd.LevelEditorPlaySettings]
- INI Section:
/Script/UnrealEd.LevelEditorPlaySettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/SLevelViewport.cpp:4161
Scope (from outer to inner):
file
function void SLevelViewport::StartPlayInEditorSession
Source code excerpt:
bPIEHasFocus = ActiveViewport->HasMouseCapture();
if(EditorPlayInSettings->ShowMouseControlLabel && !GEngine->IsStereoscopic3D( ActiveViewport.Get() ) )
{
ELabelAnchorMode AnchorMode = EditorPlayInSettings->MouseControlLabelPosition.GetValue();
ShowMouseCaptureLabel(AnchorMode);
}
#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/SLevelViewport.cpp:4451
Scope (from outer to inner):
file
function void SLevelViewport::SwapViewportsForPlayInEditor
Source code excerpt:
check(EditorPlayInSettings);
if(EditorPlayInSettings->ShowMouseControlLabel && !GEngine->IsStereoscopic3D( ActiveViewport.Get() ) )
{
ELabelAnchorMode AnchorMode = EditorPlayInSettings->MouseControlLabelPosition.GetValue();
ShowMouseCaptureLabel(AnchorMode);
}
#Loc: <Workspace>/Engine/Source/Editor/MovieSceneCaptureDialog/Private/MovieSceneCaptureDialogModule.cpp:486
Scope (from outer to inner):
file
function void FInEditorCapture::OverridePlaySettings
Source code excerpt:
// Reset everything else
PlayInEditorSettings->GameGetsMouseControl = false;
PlayInEditorSettings->ShowMouseControlLabel = false;
PlayInEditorSettings->ViewportGetsHMDControl = false;
PlayInEditorSettings->ShouldMinimizeEditorOnVRPIE = true;
PlayInEditorSettings->EnableGameSound = CaptureObject->AudioCaptureProtocolType != UNullAudioCaptureProtocol::StaticClass();
PlayInEditorSettings->bOnlyLoadVisibleLevelsInPIE = false;
PlayInEditorSettings->bPreferToStreamLevelsInPIE = false;
PlayInEditorSettings->PIEAlwaysOnTop = false;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorPlaySettings.h:233
Scope (from outer to inner):
file
class class ULevelEditorPlaySettings : public UObject
Source code excerpt:
/** Whether to show a label for mouse control gestures in the PIE view. */
UPROPERTY(config, EditAnywhere, Category=PlayInEditor)
bool ShowMouseControlLabel;
/** Location on screen to anchor the mouse control label when in PIE mode. */
UPROPERTY(config, EditAnywhere, Category=PlayInEditor)
TEnumAsByte<ELabelAnchorMode> MouseControlLabelPosition;
/** Should Play-in-Viewport respect HMD orientations (default = false) */