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:

  1. GameGetsMouseControl: Determines if the game receives mouse control during PIE.
  2. MouseControlLabelPosition: Specifies the screen location where the mouse control label should be anchored.

Developers should be aware that:

  1. This setting only takes effect when not using stereoscopic 3D rendering.
  2. 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:

  1. 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.
  2. 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.
  3. Be mindful of performance implications. While minor, displaying additional UI elements can have a small impact on rendering performance.
  4. 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]

#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) */