A horizontal row of panels (fl_horizontalbar) that can be scrolled when its contents do not fit. It extends DHorizontalScroller: add panels with AddPanel and they are lined up from the left and stretched to the height of the bar, or centered after set_centered(true). The background is left to the active theme's PaintHorizontalbar hook. Used for the character list, the stages of the character creation and the faction chooser.

Summary

Methods

Adds a panel to the bar and immediately lays the bar out again.
Init()client
Hides the scroll buttons of the underlying DHorizontalScroller until there is something to scroll to.
Delegates drawing of the bar to the active theme's PaintHorizontalbar hook.
Lines the child panels up from left to right, or centers them when set_centered is on and they fit into the bar, stretches them to the height of the bar, clamps the scroll offset and shows the scroll buttons for the sides that have panels out of view.
Sets whether the child panels are centered horizontally instead of aligned to the left.

Methods

Adds a panel to the bar and immediately lays the bar out again.

Parameters

  • pnl Panel

Hides the scroll buttons of the underlying DHorizontalScroller until there is something to scroll to.

PANEL:Paint(width, height)

client packages/active_ui/views/base/cl_horizontalbar.lua:21

Delegates drawing of the bar to the active theme's PaintHorizontalbar hook.

Parameters

  • width Number panel width
  • height Number panel height

Lines the child panels up from left to right, or centers them when set_centered is on and they fit into the bar, stretches them to the height of the bar, clamps the scroll offset and shows the scroll buttons for the sides that have panels out of view.

PANEL:set_centered(centered)

client packages/active_ui/views/base/cl_horizontalbar.lua:99

Sets whether the child panels are centered horizontally instead of aligned to the left.

Parameters

  • centered Boolean

Defined in