Hytale Modding
Modding d'Hytale

TabNavigation

TabNavigation

Accepts child elements: Yes

Properties

NameTypeDescription
TabsTab[]
VisibleBooleanHides the element. Makes the parent layouting skip this element as well
HitTestVisibleBooleanBy default, most elements won't return themselves during a HitTest check unless they expose certain functionality that requires them to (e.g. a button). This means that elements visually underneath them might receive the input event instead. If you want this element to be returned during a HitTest set this to true
TooltipTextStringEnables a text tooltip and sets the text to show. The tooltip will be shown while the mouse cursor is on this element
TooltipTextSpansList<LabelSpan>Enables a text tooltip and sets the text spans to show. The tooltip will be shown while the mouse cursor is on this element
TextTooltipStyleTextTooltipStyleStyle options for the text tooltip
TextTooltipShowDelayFloatSpecifies a delay in seconds for long the mouse has to stay on this element for the tooltip to appear
StyleTabNavigationStyle
SelectedTabString
AllowUnselectionBoolean
AnchorAnchorDefines how the element should be laid out inside its allocated area
PaddingPaddingDefines how much space to keep around the content. Background is unaffected.
FlexWeightIntegerFlexWeight can be used to distribute any left-over space after explicit widths/heights have been subtracted
ContentWidthIntegerIf set, this element will display a horizontal scrollbar
ContentHeightIntegerIf set, this element will display a vertical scrollbar
AutoScrollDownBooleanMakes the element automatically scroll down to the bottom of the element. The element won't try to scroll down if it has been scrolled up
KeepScrollPositionBooleanWhether to keep the scrolling position, even after the element has been unmounted
MouseWheelScrollBehaviourMouseWheelScrollBehaviourType
BackgroundPatchStyle / StringSets a background image or color
MaskTexturePathUI Path (String)Sets a mask texture to be used for clipping. (Doesn't support 9-patches yet)
OutlineColorColorSets the color for the outline to render
OutlineSizeFloatDraws a basic outline around the element with the specified size
OverscrollBooleanIf enabled scrolling areas will be extended by the size of the element

Event Callbacks

NameDescription
SelectedTabChanged

Example

TabNavigation requires x2 properties to function - Tabs and Style.

TabNavigation #MyTabNavigation {
  SelectedTab: "TabOne";
  Style: @CustomTopTabStyle;
  Tabs: [
    ( Id: "TabOne", Text: "Tab One", ),
    ( Id: "TabTwo", Text: "Tab Two", )
  ];
}

Known Issue

See Bug Report.

The default styling for TabNavigation found in common.ui has issues that will cause the game not to load or crash the ui. That is @TopTabsStyle and @HeaderTabsStyle, there is a syntax mismatch on a child tab style.

The style method for Tab should be TabStyleState not TabStateStyle. Therefore at the present time, developers should only use @TopTabsStyle and @HeaderTabsStyle as a reference.

Additionally the default texture assets are missing and would need to be copied into your project from the Hytale install directory. For example: TabOverlay@2x.png and TabSelectedOverlay@2x.png.