Tabbed Container.
    public class TabContainer : Container

Sets the active tab’s visible property to the value true. Sets all other children’s to false.

Ignores non-Control children.

Individual tabs are always visible unless you use SetTabDisabled(int, bool) and SetTabTitle(int, string) to hide it.

To hide only a tab’s content, nest the content inside a child Control, so it receives the TabContainer’s visibility setting instead.

Inheritance Chain

Constructors

    public TabContainer()

Signals

    "pre_popup_pressed" ()

Emitted when the TabContainer’s Popup button is clicked. See SetPopup(Godot.Node) for details.

    "tab_changed" (int tab)

Emitted when switching to another tab.

    "tab_selected" (int tab)

Emitted when a tab is selected, even if it is the current tab.

Properties

    public int CurrentTab { get; set; }

The current tab index. When set, this index’s Control node’s visible property is set to true and all others are set to false.

    public bool DragToRearrangeEnabled { get; set; }

If true, tabs can be rearranged with mouse drag.

    public TabAlignEnum TabAlign { get; set; }

The alignment of all tabs in the tab container. See the ALIGN_* constants for details.

    public bool TabsVisible { get; set; }

If true, tabs are visible. If false, tabs’ content and titles are hidden. Default value: true.

Methods

    public bool AreTabsVisible()

Getter for TabsVisible

    public int GetCurrentTab()

Getter for CurrentTab

    public Control GetCurrentTabControl()

Returns the child Control node located at the active tab index.

    public bool GetDragToRearrangeEnabled()

Getter for DragToRearrangeEnabled

    public Popup GetPopup()

Returns the Popup node instance if one has been set already with SetPopup(Godot.Node).

    public int GetPreviousTab()

Returns the previously active tab index.

    public TabAlignEnum GetTabAlign()

Getter for TabAlign

    public Control GetTabControl(int idx)

Returns the currently visible tab’s Control node.

    public int GetTabCount()

Returns the number of tabs.

    public bool GetTabDisabled(int tabIdx)

Returns true if the tab at index tabIdx is disabled.

    public Texture GetTabIcon(int tabIdx)

Returns the Texture for the tab at index tabIdx or null if the tab has no Texture.

    public int GetTabsRearrangeGroup()

Returns the TabContainer rearrange group id.

    public string GetTabTitle(int tabIdx)

Returns the title of the tab at index tabIdx. Tab titles default to the name of the indexed child node, but this can be overridden with SetTabTitle(int, string).

    public void SetCurrentTab(int tabIdx)

Setter for CurrentTab

    public void SetDragToRearrangeEnabled(bool enabled)

Setter for DragToRearrangeEnabled

    public void SetPopup(Node popup)

If set on a Popup node instance, a popup menu icon appears in the top-right corner of the TabContainer. Clicking it will expand the Popup node.

    public void SetTabAlign(TabAlignEnum align)

Setter for TabAlign

    public void SetTabDisabled(int tabIdx, bool disabled)

If disabled is false, hides the tab at index tabIdx. Note that its title text will remain, unless also removed with SetTabTitle(int, string).

    public void SetTabIcon(int tabIdx, Texture icon)

Sets an icon for the tab at index tabIdx.

    public void SetTabsRearrangeGroup(int groupId)

Defines rearrange group id, choose for each TabContainer the same value to enable tab drag between TabContainer. Enable drag with set_drag_to_rearrange_enabled(true).

    public void SetTabsVisible(bool visible)

Setter for TabsVisible

    public void SetTabTitle(int tabIdx, string title)

Sets a title for the tab at index tabIdx. Tab titles default to the name of the indexed child node, but this can be overridden with SetTabTitle(int, string).

Inner Types

TabAlignEnum

Name Value Description
Left 0 Align the tabs to the left.
Center 1 Align the tabs to the center.
Right 2 Align the tabs to the right.
Tags: