Class PauseMenu
The pause menu, which is used during gameplay is a "pause_menu_controller" is used (res://Core/Scenes/UI/Menus/pause_menu_controller.tscn). It pauses the game using the scene tree pause feature. It contains options for saving and loading as well as the same options menu as in the main menu. It also blurs the background using a weak box blur effect.
[ScriptPath("res://Core/Scenes/UI/Menus/PauseMenu.cs")]
public class PauseMenu : Control, IDisposable
- Inheritance
-
GodotObjectNodeCanvasItemControlPauseMenu
- Implements
- Inherited Members
-
Control.NotificationResizedControl.NotificationMouseEnterControl.NotificationMouseExitControl.NotificationFocusEnterControl.NotificationFocusExitControl.NotificationThemeChangedControl.NotificationScrollBeginControl.NotificationScrollEndControl.NotificationLayoutDirectionChangedControl._CanDropData(Vector2, Variant)Control._DropData(Vector2, Variant)Control._GetDragData(Vector2)Control._GetMinimumSize()Control._GetTooltip(Vector2)Control._GuiInput(InputEvent)Control._HasPoint(Vector2)Control.AcceptEvent()Control.GetMinimumSize()Control.GetCombinedMinimumSize()Control.SetBegin(Vector2)Control.SetEnd(Vector2)Control.ResetSize()Control.GetBegin()Control.GetEnd()Control.GetParentAreaSize()Control.GetScreenPosition()Control.GetRect()Control.GetGlobalRect()Control.HasFocus()Control.GrabFocus()Control.ReleaseFocus()Control.FindPrevValidFocus()Control.FindNextValidFocus()Control.BeginBulkThemeOverride()Control.EndBulkThemeOverride()Control.AddThemeIconOverride(StringName, Texture2D)Control.AddThemeStyleboxOverride(StringName, StyleBox)Control.AddThemeFontOverride(StringName, Font)Control.AddThemeColorOverride(StringName, Color)Control.RemoveThemeIconOverride(StringName)Control.RemoveThemeStyleboxOverride(StringName)Control.RemoveThemeFontOverride(StringName)Control.RemoveThemeFontSizeOverride(StringName)Control.RemoveThemeColorOverride(StringName)Control.RemoveThemeConstantOverride(StringName)Control.GetThemeIcon(StringName, StringName)Control.GetThemeStylebox(StringName, StringName)Control.GetThemeFont(StringName, StringName)Control.GetThemeFontSize(StringName, StringName)Control.GetThemeColor(StringName, StringName)Control.GetThemeConstant(StringName, StringName)Control.HasThemeIconOverride(StringName)Control.HasThemeStyleboxOverride(StringName)Control.HasThemeFontOverride(StringName)Control.HasThemeFontSizeOverride(StringName)Control.HasThemeColorOverride(StringName)Control.HasThemeConstantOverride(StringName)Control.HasThemeIcon(StringName, StringName)Control.HasThemeStylebox(StringName, StringName)Control.HasThemeFont(StringName, StringName)Control.HasThemeFontSize(StringName, StringName)Control.HasThemeColor(StringName, StringName)Control.HasThemeConstant(StringName, StringName)Control.GetThemeDefaultBaseScale()Control.GetThemeDefaultFont()Control.GetThemeDefaultFontSize()Control.GetParentControl()Control.GetTooltip(Vector2?)Control.GetCursorShape(Vector2?)Control.ForceDrag(Variant, Control)Control.GrabClickFocus()Control.SetDragForwarding(Callable, Callable, Callable)Control.SetDragPreview(Control)Control.IsDragSuccessful()Control.WarpMouse(Vector2)Control.UpdateMinimumSize()Control.IsLayoutRtl()Control.ClipContentsControl.CustomMinimumSizeControl.LayoutDirectionControl.LayoutModeControl.AnchorsPresetControl.AnchorLeftControl.AnchorTopControl.AnchorRightControl.AnchorBottomControl.OffsetLeftControl.OffsetTopControl.OffsetRightControl.OffsetBottomControl.GrowHorizontalControl.GrowVerticalControl.SizeControl.PositionControl.GlobalPositionControl.RotationControl.RotationDegreesControl.ScaleControl.PivotOffsetControl.SizeFlagsHorizontalControl.SizeFlagsVerticalControl.SizeFlagsStretchRatioControl.AutoTranslateControl.LocalizeNumeralSystemControl.TooltipTextControl.FocusNeighborLeftControl.FocusNeighborTopControl.FocusNeighborRightControl.FocusNeighborBottomControl.FocusNextControl.FocusPreviousControl.FocusModeControl.MouseFilterControl.MouseForcePassScrollEventsControl.MouseDefaultCursorShapeControl.ShortcutContextControl.ThemeControl.ThemeTypeVariationControl.ResizedControl.GuiInputControl.MouseEnteredControl.MouseExitedControl.FocusEnteredControl.FocusExitedControl.SizeFlagsChangedControl.MinimumSizeChangedControl.ThemeChangedCanvasItem.NotificationTransformChangedCanvasItem.NotificationLocalTransformChangedCanvasItem.NotificationDrawCanvasItem.NotificationVisibilityChangedCanvasItem.NotificationEnterCanvasCanvasItem.NotificationExitCanvasCanvasItem.NotificationWorld2DChangedCanvasItem._Draw()CanvasItem.GetCanvasItem()CanvasItem.IsVisibleInTree()CanvasItem.Show()CanvasItem.Hide()CanvasItem.QueueRedraw()CanvasItem.MoveToFront()CanvasItem.DrawTexture(Texture2D, Vector2, Color?)CanvasItem.DrawLcdTextureRectRegion(Texture2D, Rect2, Rect2, Color?)CanvasItem.DrawStyleBox(StyleBox, Rect2)CanvasItem.DrawPrimitive(Vector2[], Color[], Vector2[], Texture2D)CanvasItem.DrawPolygon(Vector2[], Color[], Vector2[], Texture2D)CanvasItem.DrawColoredPolygon(Vector2[], Color, Vector2[], Texture2D)CanvasItem.DrawMesh(Mesh, Texture2D, Transform2D?, Color?)CanvasItem.DrawMultimesh(MultiMesh, Texture2D)CanvasItem.DrawSetTransformMatrix(Transform2D)CanvasItem.DrawEndAnimation()CanvasItem.GetTransform()CanvasItem.GetGlobalTransform()CanvasItem.GetGlobalTransformWithCanvas()CanvasItem.GetViewportTransform()CanvasItem.GetViewportRect()CanvasItem.GetCanvasTransform()CanvasItem.GetScreenTransform()CanvasItem.GetLocalMousePosition()CanvasItem.GetGlobalMousePosition()CanvasItem.GetCanvas()CanvasItem.GetWorld2D()CanvasItem.IsLocalTransformNotificationEnabled()CanvasItem.IsTransformNotificationEnabled()CanvasItem.ForceUpdateTransform()CanvasItem.MakeCanvasPositionLocal(Vector2)CanvasItem.MakeInputLocal(InputEvent)CanvasItem.VisibleCanvasItem.ModulateCanvasItem.SelfModulateCanvasItem.ShowBehindParentCanvasItem.TopLevelCanvasItem.ClipChildrenCanvasItem.LightMaskCanvasItem.VisibilityLayerCanvasItem.ZIndexCanvasItem.ZAsRelativeCanvasItem.YSortEnabledCanvasItem.TextureFilterCanvasItem.TextureRepeatCanvasItem.MaterialCanvasItem.UseParentMaterialCanvasItem.DrawCanvasItem.VisibilityChangedCanvasItem.HiddenCanvasItem.ItemRectChangedNode.NotificationEnterTreeNode.NotificationExitTreeNode.NotificationMovedInParentNode.NotificationReadyNode.NotificationPausedNode.NotificationUnpausedNode.NotificationPhysicsProcessNode.NotificationProcessNode.NotificationParentedNode.NotificationUnparentedNode.NotificationSceneInstantiatedNode.NotificationDragBeginNode.NotificationDragEndNode.NotificationPathRenamedNode.NotificationChildOrderChangedNode.NotificationInternalProcessNode.NotificationInternalPhysicsProcessNode.NotificationPostEnterTreeNode.NotificationDisabledNode.NotificationEnabledNode.NotificationNodeRecacheRequestedNode.NotificationEditorPreSaveNode.NotificationEditorPostSaveNode.NotificationWMMouseEnterNode.NotificationWMMouseExitNode.NotificationWMWindowFocusInNode.NotificationWMWindowFocusOutNode.NotificationWMCloseRequestNode.NotificationWMGoBackRequestNode.NotificationWMSizeChangedNode.NotificationWMDpiChangeNode.NotificationVpMouseEnterNode.NotificationVpMouseExitNode.NotificationOsMemoryWarningNode.NotificationTranslationChangedNode.NotificationWMAboutNode.NotificationCrashNode.NotificationOsImeUpdateNode.NotificationApplicationResumedNode.NotificationApplicationPausedNode.NotificationApplicationFocusInNode.NotificationApplicationFocusOutNode.NotificationTextServerChangedNode.GetNode<T>(NodePath)Node.GetNodeOrNull<T>(NodePath)Node.GetOwner<T>()Node.GetOwnerOrNull<T>()Node.GetParent<T>()Node.GetParentOrNull<T>()Node._EnterTree()Node._ExitTree()Node._GetConfigurationWarnings()Node._Input(InputEvent)Node._ShortcutInput(InputEvent)Node._UnhandledKeyInput(InputEvent)Node.PrintOrphanNodes()Node.RemoveChild(Node)Node.HasNode(NodePath)Node.GetNode(NodePath)Node.GetNodeOrNull(NodePath)Node.GetParent()Node.HasNodeAndResource(NodePath)Node.GetNodeAndResource(NodePath)Node.IsInsideTree()Node.IsAncestorOf(Node)Node.IsGreaterThan(Node)Node.GetPath()Node.RemoveFromGroup(StringName)Node.IsInGroup(StringName)Node.GetGroups()Node.PrintTree()Node.PrintTreePretty()Node.GetPhysicsProcessDeltaTime()Node.IsPhysicsProcessing()Node.GetProcessDeltaTime()Node.IsProcessing()Node.IsProcessingInput()Node.IsProcessingShortcutInput()Node.IsProcessingUnhandledInput()Node.IsProcessingUnhandledKeyInput()Node.CanProcess()Node.IsDisplayedFolded()Node.IsProcessingInternal()Node.IsPhysicsProcessingInternal()Node.GetWindow()Node.GetLastExclusiveWindow()Node.GetTree()Node.CreateTween()Node.GetSceneInstanceLoadPlaceholder()Node.IsEditableInstance(Node)Node.GetViewport()Node.QueueFree()Node.RequestReady()Node.IsNodeReady()Node.GetMultiplayerAuthority()Node.IsMultiplayerAuthority()Node.RpcConfig(StringName, Variant)Node.Rpc(StringName, params Variant[])Node.UpdateConfigurationWarnings()Node.CallDeferredThreadGroup(StringName, params Variant[])Node.SetDeferredThreadGroup(StringName, Variant)Node.CallThreadSafe(StringName, params Variant[])Node.SetThreadSafe(StringName, Variant)Node._ImportPathNode.NameNode.UniqueNameInOwnerNode.SceneFilePathNode.OwnerNode.MultiplayerNode.ProcessModeNode.ProcessPriorityNode.ProcessPhysicsPriorityNode.ProcessThreadGroupNode.ProcessThreadGroupOrderNode.ProcessThreadMessagesNode.EditorDescriptionNode.ReadyNode.RenamedNode.TreeEnteredNode.TreeExitingNode.TreeExitedNode.ChildEnteredTreeNode.ChildExitingTreeNode.ChildOrderChangedNode.ReplacingByGodotObject.NotificationPostinitializeGodotObject.NotificationPredeleteGodotObject.NativeInstanceGodotObject.ScriptChangedGodotObject.PropertyListChanged
- Extension Methods
Fields
_currentPopup
The current panel that has popped up
private Control _currentPopup
Field Value
- Control
_loadLastSaveControl
The control related to loading the last save. Removed if the configration disables loading the last save while playing.
[Export(PropertyHint.None, "")]
private Control _loadLastSaveControl
Field Value
- Control
_mainMenuFile
The path to the main menu file
[Export(PropertyHint.File, "*.tscn")]
private string _mainMenuFile
Field Value
_menuPanel
The menu panel
[Export(PropertyHint.None, "")]
private Control _menuPanel
Field Value
- Control
_optionsMenuFile
The path to the options menu file
[Export(PropertyHint.None, "")]
private PackedScene _optionsMenuFile
Field Value
- PackedScene
_saveSlotRelatedElements
The controls which are related to games with multiple save slots. (Removed if SaveSlotSettings.SlotOptions != MULTI_SLOT_SAVE_DATA
)
[Export(PropertyHint.None, "")]
private Control[] _saveSlotRelatedElements
Field Value
- Control[]
Methods
CreateNewSlidingScene(PackedScene)
private void CreateNewSlidingScene(PackedScene packed)
Parameters
packed
PackedScene
ExitToMainMenu()
private void ExitToMainMenu()
OnBtnOptions()
private void OnBtnOptions()
OnBtnReloadLastSave()
private void OnBtnReloadLastSave()
OnBtnSave()
private void OnBtnSave()
ReturnToPlay()
private void ReturnToPlay()
_Ready()
Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their Godot.Node._Ready() callbacks get triggered first, and the parent node will receive the ready notification afterwards.
Corresponds to the Godot.Node.NotificationReady notification in _Notification(int). See also the @onready
annotation for variables.
Usually used for initialization. For even earlier initialization, Godot.GodotObject.GodotObject() may be used. See also Godot.Node._EnterTree().
Note:
Godot.Node._Ready() may be called only once for each node. After removing a node from the scene tree and adding it again, _ready
will not be called a second time. This can be bypassed by requesting another call with Godot.Node.RequestReady(), which may be called anywhere before adding the node again.
public override void _Ready()
_UnhandledInput(InputEvent)
Called when an Godot.InputEvent hasn't been consumed by Godot.Node._Input(Godot.InputEvent) or any GUI Godot.Control item. The input event propagates up through the node tree until a node consumes it.
It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with SetProcessUnhandledInput(bool).
To consume the input event and stop it propagating further to other nodes, Godot.Viewport.SetInputAsHandled() can be called.
For gameplay input, this and Godot.Node._UnhandledKeyInput(Godot.InputEvent) are usually a better fit than Godot.Node._Input(Godot.InputEvent) as they allow the GUI to intercept the events first.
Note: This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
public override void _UnhandledInput(InputEvent @event)
Parameters
event
InputEvent