Class MenuBar
- Namespace
- Godot
- Assembly
- GodotSharp.dll
A horizontal menu bar that creates a MenuButton for each PopupMenu child. New items are created by adding PopupMenus to this node.
public class MenuBar : Control, IDisposable
- Inheritance
-
MenuBar
- Implements
- Inherited Members
Constructors
MenuBar()
public MenuBar()
Properties
Flat
Flat MenuBar don't display item decoration.
public bool Flat { get; set; }
Property Value
Language
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
public string Language { get; set; }
Property Value
PreferGlobalMenu
If true
, MenuBar will use system global menu when supported.
public bool PreferGlobalMenu { get; set; }
Property Value
StartIndex
Position in the global menu to insert first MenuBar item at.
public int StartIndex { get; set; }
Property Value
SwitchOnHover
If true
, when the cursor hovers above menu item, it will close the current PopupMenu and open the other one.
public bool SwitchOnHover { get; set; }
Property Value
TextDirection
Base text writing direction.
public Control.TextDirection TextDirection { get; set; }
Property Value
Methods
GetMenuCount()
Returns number of menu items.
public int GetMenuCount()
Returns
GetMenuPopup(int)
Returns PopupMenu associated with menu item.
public PopupMenu GetMenuPopup(int menu)
Parameters
menu
int
Returns
GetMenuTitle(int)
Returns menu item title.
public string GetMenuTitle(int menu)
Parameters
menu
int
Returns
GetMenuTooltip(int)
Returns menu item tooltip.
public string GetMenuTooltip(int menu)
Parameters
menu
int
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
IsMenuDisabled(int)
Returns true
, if menu item is disabled.
public bool IsMenuDisabled(int menu)
Parameters
menu
int
Returns
IsMenuHidden(int)
Returns true
, if menu item is hidden.
public bool IsMenuHidden(int menu)
Parameters
menu
int
Returns
IsNativeMenu()
Returns true
, if system global menu is supported and used by this MenuBar.
public bool IsNativeMenu()
Returns
SetDisableShortcuts(bool)
If true
, shortcuts are disabled and cannot be used to trigger the button.
public void SetDisableShortcuts(bool disabled)
Parameters
disabled
bool
SetMenuDisabled(int, bool)
If true
, menu item is disabled.
public void SetMenuDisabled(int menu, bool disabled)
Parameters
SetMenuHidden(int, bool)
If true
, menu item is hidden.
public void SetMenuHidden(int menu, bool hidden)
Parameters
SetMenuTitle(int, string)
Sets menu item title.
public void SetMenuTitle(int menu, string title)
Parameters
SetMenuTooltip(int, string)
Sets menu item tooltip.
public void SetMenuTooltip(int menu, string tooltip)