> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: User Interface
icon: layout-grid
sidebar_position: 2
---

# <ApiPageIcon icon="layout-grid" />User Interface

<ApiExposes data="[{&#x22;k&#x22;:&#x22;NAMESPACE&#x22;,&#x22;c&#x22;:&#x22;fn&#x22;,&#x22;s&#x22;:&#x22;ui&#x22;,&#x22;h&#x22;:&#x22;#ui&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.Element&#x22;,&#x22;h&#x22;:&#x22;#uielement&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.Tab&#x22;,&#x22;h&#x22;:&#x22;#uitab&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;h&#x22;:&#x22;#uigroup&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;h&#x22;:&#x22;#uivariable&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;h&#x22;:&#x22;#uicolorpicker&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.ColorsNode&#x22;,&#x22;h&#x22;:&#x22;#uicolorsnode&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.ColorSet&#x22;,&#x22;h&#x22;:&#x22;#uicolorset&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.ColorCategoryNode&#x22;,&#x22;h&#x22;:&#x22;#uicolorcategorynode&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.ColorModes&#x22;,&#x22;h&#x22;:&#x22;#uicolormodes&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ui.ActiveBind&#x22;,&#x22;h&#x22;:&#x22;#uiactivebind&#x22;}]" />

## ui<ApiTag label="global table" />

Creates and reads menu elements. Scripts can add their own tabs, groups and controls to the
menu, read and change the values of these controls, and find the built-in options of the cheat
to react to them.

The paths of built-in options can change between updates. Check that the result of `ui.Lookup`
is not `nil` before you use its fields.

<ApiMembers>
  <ApiMember kind="fn" name="ui.Lookup" summary="Finds a menu element by its path. Returns `nil` if no element matches the path. Throws an error if it is called without arguments, or if a segment is not a string." args="root, ...?" sig="[{&#x22;s&#x22;:&#x22;ui.Lookup&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;root&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Lookup.Root&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-Lookup-Root&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ui.Tab&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uitab&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ui.Tab&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uitab&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}],[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;root&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.Lookup.Root&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-Lookup-Root&#x22;}],&#x22;d&#x22;:&#x22;The first segment of the path.&#x22;},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The other segments, one for each menu level.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;n&#x22;:&#x22;element&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ui.Tab&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uitab&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]},{&#x22;n&#x22;:&#x22;color&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;The colour picker of the control, if it has one.&#x22;}]" expand="[{&#x22;n&#x22;:&#x22;root&#x22;,&#x22;m&#x22;:&#x22;=&#x22;,&#x22;values&#x22;:[[&#x22;\&#x22;Aimbot\&#x22;&#x22;,&#x22;&#x22;,&#x22;&#x22;],[&#x22;\&#x22;Common\&#x22;&#x22;,&#x22;&#x22;,&#x22;&#x22;],[&#x22;\&#x22;Extensions\&#x22;&#x22;,&#x22;&#x22;,&#x22;The tabs that scripts created.&#x22;],[&#x22;\&#x22;Settings\&#x22;&#x22;,&#x22;&#x22;,&#x22;The settings of the menu, such as the language, the scale and the units.&#x22;],[&#x22;\&#x22;ESP Options\&#x22;&#x22;,&#x22;&#x22;,&#x22;The options of the ESP preview.&#x22;]]}]">
    <ApiNotes>
      A path has one segment for each menu level, from the root down to the element. The segments are
      the category, the tab, the group, any nested groups, and then the control. Write each segment as
      it is shown in the English menu. Case and colour codes are ignored, so `"Hit Chance"` and
      `"hit chance"` find the same control.

      To get the exact path of a control, turn on developer mode, right click the control and choose
      Copy Path. The generated menu reference in `menu/*.lua` lists every built-in path, with the type
      of the control and the values that it accepts.

      The type of the return value depends on where the path ends.

      | The path ends at                     | Returns                                                                                      |
      | ------------------------------------ | -------------------------------------------------------------------------------------------- |
      | a control                            | `ui.Variable`. If the control has a colour picker, the picker is returned as a second value. |
      | a group                              | `ui.Group`                                                                                   |
      | a tab                                | `ui.Tab`                                                                                     |
      | only `"Settings"` or `"ESP Options"` | `ui.Group`                                                                                   |
      | only `"Aimbot"` or `"Common"`        | `nil`                                                                                        |

      Some groups have weapon presets or map presets. By default, a path finds the element in the
      global preset. To find the element in a specific preset, add the name of the preset right after
      the tab, for example `ui.Lookup("Aimbot", "Rage", "AWP", "Selection", "Hit Chance")`.
    </ApiNotes>

    <ApiExample title="Look up menu items">
      ```lua luaintelligence=true semantic="lua:cs2:cs2/api_reference/rendering/ui:0:bf2b205c07db"
      local hit_chance = ui.Lookup("Aimbot", "Rage", "Selection", "Hit Chance") --[[@as ui.Variable?]]
      local double_tap = ui.Lookup("Common", "Visuals", "World", "Miscellaneous", "Windows", "Indicators", "Double Tap") --[[@as ui.Variable?]]
      local menu_scale = ui.Lookup("Settings", "Menu Scale") --[[@as ui.Variable?]]

      if hit_chance then print("hit chance: ", hit_chance.value) end
      if double_tap and double_tap.value then print("double tap indicator is on") end
      if menu_scale then print("menu scale: ", menu_scale.value) end
      ```
    </ApiExample>
  </ApiMember>

  <ApiMember kind="fn" name="ui.AddTab" summary="Returns the tab with the given name in the sidebar entry of your script. If the tab does not exist, it is created." args="name" sig="[{&#x22;s&#x22;:&#x22;ui.AddTab&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Tab&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uitab&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Tab&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uitab&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The name of the tab.&#x22;}]" />

  <ApiMember kind="fn" name="ui.GetAlpha" summary="Returns the current opacity of the menu, from `0` to `1`." args="" sig="[{&#x22;s&#x22;:&#x22;ui.GetAlpha&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="fn" name="ui.GetScale" summary="Returns the DPI scale factor of the given part of the interface." args="type?" sig="[{&#x22;s&#x22;:&#x22;ui.GetScale&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;type&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ScaleType&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ScaleType&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;type&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.ScaleType&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ScaleType&#x22;}],&#x22;d&#x22;:&#x22;The part of the interface. The default is `ui.ScaleType.kMenu`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="ui.Scaled" summary="Returns `value` multiplied by the DPI scale factor of the given part of the interface." args="value, type?" sig="[{&#x22;s&#x22;:&#x22;ui.Scaled&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;type&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ScaleType&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ScaleType&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The value to scale.&#x22;},{&#x22;n&#x22;:&#x22;type&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.ScaleType&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ScaleType&#x22;}],&#x22;d&#x22;:&#x22;The part of the interface. The default is `ui.ScaleType.kMenu`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="ui.GetPosition" summary="Returns the position of the top left corner of the main menu window. Returns `nil` if the menu window has not been created yet." args="" sig="[{&#x22;s&#x22;:&#x22;ui.GetPosition&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;}]]" />

  <ApiMember kind="fn" name="ui.GetSize" summary="Returns the size of the main menu window. Returns `nil` if the menu window has not been created yet." args="" sig="[{&#x22;s&#x22;:&#x22;ui.GetSize&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;}]]" />

  <ApiMember kind="fn" name="ui.GetCursorPosition" summary="Returns the current position of the mouse cursor on the screen." args="" sig="[{&#x22;s&#x22;:&#x22;ui.GetCursorPosition&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;}]]" />

  <ApiMember kind="fn" name="ui.GetStyleColor" summary="Returns one colour of the current menu theme. Returns `nil` if the name is not a known colour name." args="name" sig="[{&#x22;s&#x22;:&#x22;ui.GetStyleColor&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.StyleName&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-StyleName&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.StyleName&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-StyleName&#x22;}],&#x22;d&#x22;:&#x22;The name of the theme colour.&#x22;}]" expand="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;m&#x22;:&#x22;=&#x22;,&#x22;values&#x22;:[[&#x22;\&#x22;Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Text&#x22;],[&#x22;\&#x22;Disabled Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Disabled Text&#x22;],[&#x22;\&#x22;Active Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Active Text&#x22;],[&#x22;\&#x22;Small Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Small Text&#x22;],[&#x22;\&#x22;Grey Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Grey Text&#x22;],[&#x22;\&#x22;Logo\&#x22;&#x22;,&#x22;&#x22;,&#x22;Logo&#x22;],[&#x22;\&#x22;Sidebar Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Sidebar Background&#x22;],[&#x22;\&#x22;Popup Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Popup Background&#x22;],[&#x22;\&#x22;Main Window Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Main Window Background&#x22;],[&#x22;\&#x22;Preview Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Preview Background&#x22;],[&#x22;\&#x22;Border\&#x22;&#x22;,&#x22;&#x22;,&#x22;Border&#x22;],[&#x22;\&#x22;Frame Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Frame Background&#x22;],[&#x22;\&#x22;Frame Active Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Frame Active Background&#x22;],[&#x22;\&#x22;Text Preview\&#x22;&#x22;,&#x22;&#x22;,&#x22;Text Preview&#x22;],[&#x22;\&#x22;Window Title\&#x22;&#x22;,&#x22;&#x22;,&#x22;Window Title&#x22;],[&#x22;\&#x22;Active Window Title\&#x22;&#x22;,&#x22;&#x22;,&#x22;Active Window Title&#x22;],[&#x22;\&#x22;Scrollbar Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Scrollbar Background&#x22;],[&#x22;\&#x22;Scrollbar Grab\&#x22;&#x22;,&#x22;&#x22;,&#x22;Scrollbar Grab&#x22;],[&#x22;\&#x22;Scrollbar Grab Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Scrollbar Grab Active&#x22;],[&#x22;\&#x22;Switch\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch&#x22;],[&#x22;\&#x22;Switch Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch Active&#x22;],[&#x22;\&#x22;Switch Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch Background&#x22;],[&#x22;\&#x22;Switch Active Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch Active Background&#x22;],[&#x22;\&#x22;Slider Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Background&#x22;],[&#x22;\&#x22;Slider Active Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Active Background&#x22;],[&#x22;\&#x22;Slider Grab\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Grab&#x22;],[&#x22;\&#x22;Slider Grab Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Grab Active&#x22;],[&#x22;\&#x22;Button\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button&#x22;],[&#x22;\&#x22;Button Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button Active&#x22;],[&#x22;\&#x22;Button Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button Text&#x22;],[&#x22;\&#x22;Button Active Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button Active Text&#x22;],[&#x22;\&#x22;Link\&#x22;&#x22;,&#x22;&#x22;,&#x22;Link&#x22;],[&#x22;\&#x22;Link Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Link Active&#x22;],[&#x22;\&#x22;Selection\&#x22;&#x22;,&#x22;&#x22;,&#x22;Selection&#x22;],[&#x22;\&#x22;Separator\&#x22;&#x22;,&#x22;&#x22;,&#x22;Separator&#x22;],[&#x22;\&#x22;Tab\&#x22;&#x22;,&#x22;&#x22;,&#x22;Tab&#x22;],[&#x22;\&#x22;Text Selection\&#x22;&#x22;,&#x22;&#x22;,&#x22;Text Selection&#x22;],[&#x22;\&#x22;Shadows\&#x22;&#x22;,&#x22;&#x22;,&#x22;Shadows&#x22;],[&#x22;\&#x22;Spinner\&#x22;&#x22;,&#x22;&#x22;,&#x22;Spinner&#x22;],[&#x22;\&#x22;Block Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Block Background&#x22;],[&#x22;\&#x22;Sidebar Selection\&#x22;&#x22;,&#x22;&#x22;,&#x22;Sidebar Selection&#x22;],[&#x22;\&#x22;Logo Back\&#x22;&#x22;,&#x22;&#x22;,&#x22;Logo Back&#x22;],[&#x22;\&#x22;Transparent Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Transparent Background&#x22;]]}]" />

  <ApiMember kind="fn" name="ui.GetStyle" summary="Returns all colours of the current menu theme in a table. The keys are the colour names and the values are `Color` objects." args="" sig="[{&#x22;s&#x22;:&#x22;ui.GetStyle&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]]" />

  <ApiMember kind="fn" name="ui.SetSidebarEntry" summary="Sets the name, the icon, or both, of the sidebar entry of your script. If the entry does not exist yet, it is created." args="name?, icon?" sig="[{&#x22;s&#x22;:&#x22;ui.SetSidebarEntry&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;icon&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The new name. Pass `nil` to keep the current name.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;icon&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The name of the new icon. Pass `nil` to keep the current icon. If the name is not a known icon name, the string is used as the icon as it is.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="fn" name="ui.Localize" summary="Adds a translation of a menu string for one language. When the user selects that language, the menu shows the translation. Throws an error if the language is not known." args="lang, name, value" sig="[{&#x22;s&#x22;:&#x22;ui.Localize&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;lang&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;lang&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The short name of the language, such as `\&#x22;en\&#x22;` for English. A custom language uses the name of its file.&#x22;},{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The original string.&#x22;},{&#x22;n&#x22;:&#x22;value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The translation that is shown when this language is selected.&#x22;}]">
    <ApiNotes>
      `name` is a string that your script uses as menu text, such as the name of a control.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="ui.GetUnitSystem" summary="Returns the measurement system that the user selected in the menu, either `&#x22;imperial&#x22;` or `&#x22;metric&#x22;`." args="" sig="[{&#x22;s&#x22;:&#x22;ui.GetUnitSystem&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.UnitSystem&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-UnitSystem&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.UnitSystem&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-UnitSystem&#x22;}]]" />

  <ApiMember kind="fn" name="ui.ConvertDistance" summary="Converts a distance in game units to the measurement system of the user. One game unit is one inch." args="distance" sig="[{&#x22;s&#x22;:&#x22;ui.ConvertDistance&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;distance&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;ui.UnitSystem&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-UnitSystem&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],[{&#x22;s&#x22;:&#x22;ui.UnitSystem&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-UnitSystem&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;distance&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The distance in game units.&#x22;}]">
    <ApiNotes>
      Returns three values. The first value is the converted distance. The second value is the unit
      suffix, `"m"` for metres or `"ft"` for feet. The third value is the measurement system, either
      `"imperial"` or `"metric"`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="ui.GetActiveBinds" summary="Returns the key binds that are active now." args="include_hidden?" sig="[{&#x22;s&#x22;:&#x22;ui.GetActiveBinds&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;include_hidden&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ActiveBind&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uiactivebind&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.ActiveBind&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uiactivebind&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;include_hidden&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also return the binds that are hidden from the list. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="type" name="ui.Lookup.Root" summary="The first segment of a path for `ui.Lookup`." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" expand="[{&#x22;n&#x22;:&#x22;&#x22;,&#x22;values&#x22;:[[&#x22;\&#x22;Aimbot\&#x22;&#x22;,&#x22;&#x22;,&#x22;&#x22;],[&#x22;\&#x22;Common\&#x22;&#x22;,&#x22;&#x22;,&#x22;&#x22;],[&#x22;\&#x22;Extensions\&#x22;&#x22;,&#x22;&#x22;,&#x22;The tabs that scripts created.&#x22;],[&#x22;\&#x22;Settings\&#x22;&#x22;,&#x22;&#x22;,&#x22;The settings of the menu, such as the language, the scale and the units.&#x22;],[&#x22;\&#x22;ESP Options\&#x22;&#x22;,&#x22;&#x22;,&#x22;The options of the ESP preview.&#x22;]]}]" />

  <ApiMember kind="type" name="ui.StyleName" summary="The names of the colours in the menu theme." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" expand="[{&#x22;n&#x22;:&#x22;&#x22;,&#x22;values&#x22;:[[&#x22;\&#x22;Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Text&#x22;],[&#x22;\&#x22;Disabled Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Disabled Text&#x22;],[&#x22;\&#x22;Active Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Active Text&#x22;],[&#x22;\&#x22;Small Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Small Text&#x22;],[&#x22;\&#x22;Grey Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Grey Text&#x22;],[&#x22;\&#x22;Logo\&#x22;&#x22;,&#x22;&#x22;,&#x22;Logo&#x22;],[&#x22;\&#x22;Sidebar Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Sidebar Background&#x22;],[&#x22;\&#x22;Popup Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Popup Background&#x22;],[&#x22;\&#x22;Main Window Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Main Window Background&#x22;],[&#x22;\&#x22;Preview Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Preview Background&#x22;],[&#x22;\&#x22;Border\&#x22;&#x22;,&#x22;&#x22;,&#x22;Border&#x22;],[&#x22;\&#x22;Frame Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Frame Background&#x22;],[&#x22;\&#x22;Frame Active Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Frame Active Background&#x22;],[&#x22;\&#x22;Text Preview\&#x22;&#x22;,&#x22;&#x22;,&#x22;Text Preview&#x22;],[&#x22;\&#x22;Window Title\&#x22;&#x22;,&#x22;&#x22;,&#x22;Window Title&#x22;],[&#x22;\&#x22;Active Window Title\&#x22;&#x22;,&#x22;&#x22;,&#x22;Active Window Title&#x22;],[&#x22;\&#x22;Scrollbar Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Scrollbar Background&#x22;],[&#x22;\&#x22;Scrollbar Grab\&#x22;&#x22;,&#x22;&#x22;,&#x22;Scrollbar Grab&#x22;],[&#x22;\&#x22;Scrollbar Grab Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Scrollbar Grab Active&#x22;],[&#x22;\&#x22;Switch\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch&#x22;],[&#x22;\&#x22;Switch Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch Active&#x22;],[&#x22;\&#x22;Switch Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch Background&#x22;],[&#x22;\&#x22;Switch Active Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Switch Active Background&#x22;],[&#x22;\&#x22;Slider Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Background&#x22;],[&#x22;\&#x22;Slider Active Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Active Background&#x22;],[&#x22;\&#x22;Slider Grab\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Grab&#x22;],[&#x22;\&#x22;Slider Grab Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Slider Grab Active&#x22;],[&#x22;\&#x22;Button\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button&#x22;],[&#x22;\&#x22;Button Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button Active&#x22;],[&#x22;\&#x22;Button Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button Text&#x22;],[&#x22;\&#x22;Button Active Text\&#x22;&#x22;,&#x22;&#x22;,&#x22;Button Active Text&#x22;],[&#x22;\&#x22;Link\&#x22;&#x22;,&#x22;&#x22;,&#x22;Link&#x22;],[&#x22;\&#x22;Link Active\&#x22;&#x22;,&#x22;&#x22;,&#x22;Link Active&#x22;],[&#x22;\&#x22;Selection\&#x22;&#x22;,&#x22;&#x22;,&#x22;Selection&#x22;],[&#x22;\&#x22;Separator\&#x22;&#x22;,&#x22;&#x22;,&#x22;Separator&#x22;],[&#x22;\&#x22;Tab\&#x22;&#x22;,&#x22;&#x22;,&#x22;Tab&#x22;],[&#x22;\&#x22;Text Selection\&#x22;&#x22;,&#x22;&#x22;,&#x22;Text Selection&#x22;],[&#x22;\&#x22;Shadows\&#x22;&#x22;,&#x22;&#x22;,&#x22;Shadows&#x22;],[&#x22;\&#x22;Spinner\&#x22;&#x22;,&#x22;&#x22;,&#x22;Spinner&#x22;],[&#x22;\&#x22;Block Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Block Background&#x22;],[&#x22;\&#x22;Sidebar Selection\&#x22;&#x22;,&#x22;&#x22;,&#x22;Sidebar Selection&#x22;],[&#x22;\&#x22;Logo Back\&#x22;&#x22;,&#x22;&#x22;,&#x22;Logo Back&#x22;],[&#x22;\&#x22;Transparent Background\&#x22;&#x22;,&#x22;&#x22;,&#x22;Transparent Background&#x22;]]}]" />

  <ApiMember kind="type" name="ui.UnitSystem" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" expand="[{&#x22;n&#x22;:&#x22;&#x22;,&#x22;values&#x22;:[[&#x22;\&#x22;imperial\&#x22;&#x22;,&#x22;&#x22;,&#x22;&#x22;],[&#x22;\&#x22;metric\&#x22;&#x22;,&#x22;&#x22;,&#x22;&#x22;]]}]" />

  <ApiMember kind="type" name="ui.ColorKey" summary="Selects a colour in a set or in a category, either by its position starting at 1 or by its name." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="type" name="ui.ScaleType" summary="The parts of the interface that each have their own DPI scale." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]">
    <ApiEnum name="ui.ScaleType" values="[[&#x22;kMenu&#x22;,&#x22;0&#x22;,&#x22;The menu.&#x22;],[&#x22;kWindows&#x22;,&#x22;1&#x22;,&#x22;The windows on the screen, such as the event log.&#x22;],[&#x22;kEsp&#x22;,&#x22;2&#x22;,&#x22;The ESP.&#x22;]]" />
  </ApiMember>

  <ApiMember kind="type" name="ui.GroupColumn" summary="The column that a group is placed in." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]">
    <ApiEnum name="ui.GroupColumn" values="[[&#x22;kAuto&#x22;,&#x22;-1&#x22;,&#x22;The tab chooses the column.&#x22;],[&#x22;kLeft&#x22;,&#x22;0&#x22;,&#x22;The left column.&#x22;],[&#x22;kRight&#x22;,&#x22;1&#x22;,&#x22;The right column.&#x22;]]" />
  </ApiMember>
</ApiMembers>

## ui.Element<ApiTag label="object type" />

The fields and methods that all menu element handles share. Tabs, groups and controls are all
elements.

Read a field to get its value, and assign the field to change it. Reading or assigning a field
that the element does not have throws an error. Assigning a read only field also throws an
error.

Two handles are equal with `==` when they point to the same element. For example, two calls to
`ui.Lookup` with the same path return equal handles.

You can read the fields of any element. You can assign `name`, `visible`, `disabled` and `icon`
only on elements that your script created. Assigning them on other elements throws an error.

<ApiMembers>
  <ApiMember kind="prop" name="ui.Element.disabled" summary="Whether the element is disabled. A disabled element is grey and the user cannot change it." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Element.icon" summary="The name of the icon of the element." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Element.id" summary="A number that identifies the element. It is unique in the current session and is never used again for another element in that session. Read only. The element gets a new number after a reload or a restart, so do not save it." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Element.name" summary="The name of the element, as it is shown in the English menu." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Element.visible" summary="Whether the element is shown." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="method" name="ui.Element:Export" summary="Returns the current state of the element as a JSON string." args="" sig="[{&#x22;s&#x22;:&#x22;ui.Element:Export&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="method" name="ui.Element:Import" summary="Sets the state of the element from a string that `Export` returned. Throws an error if the string is not valid JSON." args="str" sig="[{&#x22;s&#x22;:&#x22;ui.Element:Import&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;str&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;str&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;A string that `Export` returned.&#x22;}]" />
</ApiMembers>

## ui.Tab<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;ui.Element&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uielement&#x22;}]" />

A tab in the sidebar of the menu. A tab holds groups.

<ApiMembers>
  <ApiMember kind="method" name="ui.Tab:AddGroup" summary="Returns the group with the given name in this tab. If the group does not exist, it is created." args="name, column?" sig="[{&#x22;s&#x22;:&#x22;ui.Tab:AddGroup&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;column&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.GroupColumn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-GroupColumn&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The name of the group.&#x22;},{&#x22;n&#x22;:&#x22;column&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.GroupColumn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-GroupColumn&#x22;}],&#x22;d&#x22;:&#x22;The column of the group. The default is `ui.GroupColumn.kAuto`.&#x22;,&#x22;o&#x22;:true}]" />
</ApiMembers>

## ui.Group<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;ui.Element&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uielement&#x22;}]" />

A group in a tab. A group holds controls.

<ApiMembers>
  <ApiMember kind="method" name="ui.Group:Entity" summary="Adds an entity selector with a colour picker. This is a menu control, and it is not related to game entities. Use `Chip` on the returned control to add items that the user can select." args="name, default_color?" sig="[{&#x22;s&#x22;:&#x22;ui.Group:Entity&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;default_color&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}],[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the selector.&#x22;},{&#x22;n&#x22;:&#x22;default_color&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The starting colour, as a `Color` or a hex string. The default is white.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;n&#x22;:&#x22;control&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]},{&#x22;n&#x22;:&#x22;color&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]}]">
    <ApiNotes>
      The main switch and each chip have their own colour, like the world entities in the ESP
      settings.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="ui.Group:AddToggle" summary="Adds a checkbox." args="name, default_value?" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddToggle&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;default_value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;default_value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;The starting state. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Group:AddCombo" summary="Adds a dropdown where the user selects one item. The first item is selected at the start." args="name, items" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddCombo&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;items&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;items&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;The names of the items that the user can select.&#x22;}]" />

  <ApiMember kind="method" name="ui.Group:AddMultiCombo" summary="Adds a dropdown where the user can select several items. No item is selected at the start. Throws an error if there are more than 32 items." args="name, items" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddMultiCombo&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;items&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;items&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;The names of the items that the user can select.&#x22;}]" />

  <ApiMember kind="method" name="ui.Group:AddList" summary="Adds a list where the user selects one item. The first item is selected at the start." args="name, items" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddList&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;items&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;items&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;The names of the items that the user can select.&#x22;}]" />

  <ApiMember kind="method" name="ui.Group:AddMultiList" summary="Adds a list where the user can select several items. No item is selected at the start. Throws an error if there are more than 32 items." args="name, items" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddMultiList&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;items&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;items&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;The names of the items that the user can select.&#x22;}]" />

  <ApiMember kind="method" name="ui.Group:AddTextBox" summary="Adds a text input." args="name, default_value?" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddTextBox&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;default_value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;default_value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The starting text. The default is an empty string.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Group:AddLabel" summary="Adds a line of text that the user cannot change." args="name" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddLabel&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The text of the label.&#x22;}]" />

  <ApiMember kind="method" name="ui.Group:AddButton" summary="Adds a button. Use `AddCallback` on the returned control to run code when the button is clicked." args="name" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddButton&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the button.&#x22;}]" />

  <ApiMember kind="method" name="ui.Group:AddHotkey" summary="Adds a hotkey control." args="name, default_key?" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddHotkey&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;default_key&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;default_key&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The starting key code. The default is `0`, which means that no key is bound.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Group:AddColorPicker" summary="Adds a colour picker with one colour." args="name, default_value?" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddColorPicker&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;default_value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;default_value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}],&#x22;d&#x22;:&#x22;The starting colour, as a `Color` or a hex string such as `\&#x22;#RRGGBB\&#x22;` or `\&#x22;#RRGGBBAA\&#x22;`. The default is white.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Group:AddColorSet" summary="Adds a colour set. A colour set is an ordered list of two or more colours, and each colour has a fixed role. For example, the first colour can be the start of a gradient and the second colour can be the end. Throws an error if there are fewer than two colours." args="name, colors" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddColorSet&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;colors&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;{&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;}&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorSet&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorset&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.ColorSet&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorset&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;colors&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;{&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;}&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}],&#x22;d&#x22;:&#x22;The colours in order. Each entry is a `Color`, or a table with a `name` and a `value`.&#x22;}]" />

  <ApiMember kind="method" name="ui.Group:AddColorModes" summary="Adds a mode picker. A mode picker has two or more categories, and each category has its own colours. The user selects one category at a time. Throws an error if there are fewer than two categories." args="name, categories" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddColorModes&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;categories&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorModes.Mode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ColorModes-Mode&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorModes&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolormodes&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.ColorModes&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolormodes&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;categories&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.ColorModes.Mode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ColorModes-Mode&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}],&#x22;d&#x22;:&#x22;The modes that the user can select.&#x22;}]">
    <ApiNotes>
      With up to three categories, the categories are shown as tabs. With more than three categories,
      they are shown in a dropdown.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="ui.Group:AddImage" summary="Adds an image to the menu." args="image, size?, rounding?, mode?, color?" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddImage&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;image&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Image&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/render#image&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;size&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;rounding&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;mode&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;render.ImageMode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/render#render-ImageMode&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;color&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;image&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Image&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/render#image&#x22;}],&#x22;d&#x22;:&#x22;The image to show.&#x22;},{&#x22;n&#x22;:&#x22;size&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector2D&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector2#vector2d&#x22;}],&#x22;d&#x22;:&#x22;The size of the image. If both parts are `0`, the original size of the image is used. If one part is `0`, it is calculated from the other part so that the image keeps its proportions. The default is the original size.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;rounding&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The radius of the rounded corners. The default is `0`.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;mode&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;render.ImageMode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/render#render-ImageMode&#x22;}],&#x22;d&#x22;:&#x22;How the image fills its size. The default is `render.ImageMode.kFill`.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;color&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;}],&#x22;d&#x22;:&#x22;The colour that the image is tinted with. The default is white.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Group:AddSlider" summary="Adds a slider. A slider stores an integer. `min` and `max` are rounded to the nearest integer. Throws an error if `min` or `max` is not a finite number, or if `max` is less than `min`." args="name, min, max, default?, scale?, format?" sig="[{&#x22;s&#x22;:&#x22;ui.Group:AddSlider&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;min&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;max&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;default&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;scale&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;format&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Group.AddSlider.Format&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-Group-AddSlider-Format&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the control.&#x22;},{&#x22;n&#x22;:&#x22;min&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The smallest value.&#x22;},{&#x22;n&#x22;:&#x22;max&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The largest value.&#x22;},{&#x22;n&#x22;:&#x22;default&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The starting value. It is rounded and kept between `min` and `max`. The default is `min`.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;scale&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The shown value is the stored value multiplied by this number. For example, `0.1` shows one decimal place. It must be a finite number other than zero, or an error is thrown. The default is `1`.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;format&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.Group.AddSlider.Format&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-Group-AddSlider-Format&#x22;}],&#x22;d&#x22;:&#x22;How the value is shown.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="type" name="ui.Group.AddSlider.Format" summary="Sets how the value of a slider is shown." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]">
    <ApiNotes>
      Pass a string to show it as a suffix after the number. The string is cut to five bytes, without
      splitting a character. It is not a printf format.

      Pass a function to build the whole text from the stored integer value. If the range of the
      slider is wider than 65536 steps, the function is not used and an error message is printed.
    </ApiNotes>
  </ApiMember>
</ApiMembers>

## ui.Variable<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;ui.Element&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uielement&#x22;}]" />

A control in a group. Read `v.value` to get the value, and assign `v.value = x` to change it.
The type of `value` depends on the type of the control.

| Control      | `value`                                                                                                              |
| ------------ | -------------------------------------------------------------------------------------------------------------------- |
| toggle       | `boolean`                                                                                                            |
| slider       | `integer`, the stored value before the scale is applied                                                              |
| combo        | `string`, the name of the selected item                                                                              |
| list         | `integer`, the position of the selected item, starting at 1                                                          |
| multicombo   | `string[]`, the names of the selected items                                                                          |
| multilist    | `integer[]`, the positions of the selected items, starting at 1                                                      |
| textbox      | `string`                                                                                                             |
| label        | `string`, the text of the label. Assigning it has no effect.                                                         |
| button       | `true` in the frame when the button is clicked. Assigning any value clicks the button.                               |
| color picker | `Color`. See `ui.ColorPicker`.                                                                                       |
| color set    | A view of the colours. See `ui.ColorSet`.                                                                            |
| color modes  | A view of the categories. See `ui.ColorModes`.                                                                       |
| skyboxes     | `string`, the material file name without the extension, such as `"sky_de_dust2"`. `"Default"` is the sky of the map. |

When you assign a combo, the name is compared without case, and a name that is not in the list
is ignored. To assign a multicombo or a multilist, pass a list of item names or positions, or a
table with item names as keys and `true` as values.

A skybox selector lists its names in `items`. Until the game materials are scanned, the list
holds only `"Default"`, and reading a selected skybox returns `nil`. After the scan, assigning a
name that is not in the list is ignored. Assigning a value that is not a string throws an error.

Some fields exist only for some control types. These are `values`, `raw_values`,
`effective_values`, `is_down`, `items`, `min`, `max`, `category` and `categories`. Reading them
on other control types throws an error, in the same way as unknown fields.

<ApiMembers>
  <ApiMember kind="prop" name="ui.Variable.default" summary="The default value, which the control is reset to. You can assign it only on controls that your script created. Assigning it also sets the value, unless the config of the user already has a saved value for this control. In that case, the saved value is kept. An active override is not changed." ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.effective_value" summary="The value that features use. This is `raw_value` if an override is set, and `value` if not. Read only. It is the same as `variable:Get()`." ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.effective_values" summary="Multi select controls only. The override if there is one, and the selected items if not. Read only." ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.is_down" summary="Hotkeys only. Whether the hotkey is active now. Read only." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.items" summary="Combos, lists and skybox selectors only. The names of the items. Assign a table to replace the items of a combo or a list that your script created. The items of a skybox selector are read only." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.max" summary="Sliders only. The largest value. You can assign it only on sliders that your script created. The new value must be a finite number that is greater than `min`, or an error is thrown. If the range becomes wider than 65536 steps, the format function is no longer used." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.min" summary="Sliders only. The smallest value. You can assign it only on sliders that your script created. The new value must be a finite number that is less than `max`, or an error is thrown. If the range becomes wider than 65536 steps, the format function is no longer used." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.parent" summary="The group that holds this control. Read only." ret="[[{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.raw_value" summary="The override. Reading it returns the active override, or `nil` if there is none. Assigning it sets an override that features use instead of `value`, and the config of the user is not changed. Assign `nil` to remove the override." ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.raw_values" summary="Multi select controls only. The override as a table in the same form, or `nil` if there is no override. Assigning it works like assigning `raw_value`." ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.tooltip" summary="The tooltip text. You can assign it only on controls that your script created." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.type" summary="The name of the control type, such as `toggle`, `slider` or `combo`. Read only." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.value" summary="The value in the menu. Reading it ignores an active override." ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" />

  <ApiMember kind="prop" name="ui.Variable.values" summary="Multi select controls only. The selected items as a table, with item names as keys and `true` as values. Assigning it works like assigning `value`." ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;}]]" />

  <ApiMember kind="method" name="ui.Variable:Get" summary="Returns the value that features use. This is the `raw_value` override if one is set, and `value` if not. Without arguments, it is the same as reading `effective_value`. For colour sets and colour modes, it returns a view of the colours." args="...?" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:Get&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;Multi select controls only. The name or the position of the item to check.&#x22;,&#x22;o&#x22;:true}]">
    <ApiNotes>
      For multi select controls, you can pass the name of an item, or its position starting at 1. The
      function then returns whether that item is selected, instead of the whole selection.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="ui.Variable:GetValue" summary="Returns the value in the menu and ignores an active override. This is the method form of reading `value`. Multi select controls accept the same arguments as `Get`." args="...?" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:GetValue&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;Multi select controls only. The name or the position of the item to check.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Variable:SetValue" summary="Sets the value in the menu. This also removes an active override. This is the method form of assigning `value`." args="value" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:SetValue&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;The new value, in the form that `value` accepts for this control type.&#x22;}]" />

  <ApiMember kind="method" name="ui.Variable:GetRawValue" summary="Returns the active override, or **nil** if there is none. This is the method form of reading `raw_value`. Multi select controls accept the same arguments as `Get`." args="...?" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:GetRawValue&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;Multi select controls only. The name or the position of the item to check.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Variable:SetRawValue" summary="Sets an override that features use instead of the menu value. The config of the user is not changed. Pass **nil** to remove the override. This is the method form of assigning `raw_value`." args="value" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:SetRawValue&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;The override value, or `nil` to remove the override.&#x22;}]" />

  <ApiMember kind="method" name="ui.Variable:Chip" summary="Adds a chip to an entity selector that your script created. The user can select the chip, and the chip has its own colour. Throws an error if the control is not an entity selector, or if another script created it." args="name, default_value?" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:Chip&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;default_value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}],[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;name&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The label of the chip.&#x22;},{&#x22;n&#x22;:&#x22;default_value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;The starting selection. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;n&#x22;:&#x22;control&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]},{&#x22;n&#x22;:&#x22;color&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]}]" />

  <ApiMember kind="method" name="ui.Variable:AddGroup" summary="Returns a group that is attached to this control, so that you can add controls inside it. If the control already has such a group, that group is returned. Throws an error if the control is itself inside a group that is attached to another control." args="" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:AddGroup&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Group&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uigroup&#x22;}]]" />

  <ApiMember kind="method" name="ui.Variable:AddCallback" summary="Adds a function that is called with the control when its value changes. You can add several different functions. Adding the same function again has no effect." args="fn, call_now?" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:AddCallback&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;fn&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;self&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;call_now&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;fn&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;self&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}],&#x22;d&#x22;:&#x22;The function to add.&#x22;},{&#x22;n&#x22;:&#x22;call_now&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;Pass `true` to also call `fn` once right away. The default is `false`.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}],&#x22;d&#x22;:&#x22;The same control, so that you can chain calls.&#x22;}]">
    <ApiNotes>
      Pass `true` for `call_now` to also call the function once right away. If the function throws
      an error, the error is printed and is not passed to the caller.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="ui.Variable:RemoveCallback" summary="Removes a function that was added with `AddCallback`. Pass the same function value that you added." args="fn" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:RemoveCallback&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;fn&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;self&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;fn&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;self&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}],&#x22;d&#x22;:&#x22;The function to remove.&#x22;}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}],&#x22;d&#x22;:&#x22;The same control, so that you can chain calls.&#x22;}]" />

  <ApiMember kind="method" name="ui.Variable:AddColorPicker" summary="Adds a colour picker with one colour next to this control, for example next to a toggle, and returns the picker. Throws an error if your script did not create the control, or if the control does not support colour pickers." args="default_value?" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:AddColorPicker&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;default_value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.ColorPicker&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorpicker&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;default_value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}],&#x22;d&#x22;:&#x22;The starting colour, as a `Color` or a hex string. The default is white.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="method" name="ui.Variable:AddColorSet" summary="Adds a colour set with two or more colours, each with a fixed role, next to this control, and returns the picker. Throws an error if there are fewer than two colours, if your script did not create the control, or if the control does not support colour pickers." args="colors" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:AddColorSet&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;colors&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;{&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;}&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorSet&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorset&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.ColorSet&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorset&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;colors&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;{&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;}&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}],&#x22;d&#x22;:&#x22;The colours in order.&#x22;}]" />

  <ApiMember kind="method" name="ui.Variable:AddColorModes" summary="Adds a mode picker with two or more categories next to this control, and returns the picker. Throws an error if there are fewer than two categories, if your script did not create the control, or if the control does not support colour pickers." args="categories" sig="[{&#x22;s&#x22;:&#x22;ui.Variable:AddColorModes&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;categories&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorModes.Mode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ColorModes-Mode&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ui.ColorModes&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolormodes&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ui.ColorModes&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolormodes&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;categories&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ui.ColorModes.Mode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#ui-ColorModes-Mode&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}],&#x22;d&#x22;:&#x22;The modes that the user can select.&#x22;}]" />
</ApiMembers>

## ui.ColorPicker<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;ui.Variable&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" />

A picker with exactly one colour. `value`, `raw_value` and `default` are plain `Color` values.

<ApiMembers>
  <ApiMember kind="prop" name="ui.ColorPicker.default" summary="The default colour." ret="[[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorPicker.raw_value" summary="The override colour, or `nil` if there is none. Assign `nil` to remove the override." ret="[[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorPicker.value" summary="The colour." ret="[[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;}]]" />
</ApiMembers>

## ui.ColorsNode<ApiTag label="object type" />

A live view of the colours of a colour set. Index it with a `ui.ColorKey` to read a `Color` or
to assign one. An assignment changes the control right away. The view supports `#`, `pairs` and
`ipairs`. With `pairs`, the keys are the colour names, or the positions for colours that have no
name.

When you get the view through `raw_value`, reading a colour that has no override returns `nil`.
Assigning `nil` to a colour removes the override of that colour only. In other views, assigning
`nil` throws an error.

The view always shows the current state of the control, so you can keep it for as long as you
want.

<ApiMembers>
  <ApiMember kind="prop" name="ui.ColorsNode[string|integer]" ret="[[{&#x22;s&#x22;:&#x22;Color&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/color#color-1&#x22;}]]" />

  <ApiMember kind="meta" name="#ui.ColorsNode" syntax="#a" mm="__len" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />
</ApiMembers>

## ui.ColorSet<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;ui.Variable&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" />

A picker with an ordered set of two or more colours, each with a fixed role. It has no single
value. Use `value[color]` to read or assign one colour.

<ApiMembers>
  <ApiMember kind="prop" name="ui.ColorSet.default" summary="The default colours, one for each colour. You can assign them only on pickers that your script created. If the config of the user has a saved value, the saved value is kept." ret="[[{&#x22;s&#x22;:&#x22;ui.ColorsNode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorsnode&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorSet.raw_value" summary="The overrides, one for each colour. You can override each colour separately. Assign `nil` to the field itself to remove all overrides." ret="[[{&#x22;s&#x22;:&#x22;ui.ColorsNode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorsnode&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorSet.value" summary="The colours. `v.value['start'] = Color(...)` changes one colour." ret="[[{&#x22;s&#x22;:&#x22;ui.ColorsNode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorsnode&#x22;}]]" />
</ApiMembers>

## ui.ColorCategoryNode<ApiTag label="object type" />

A live view of the categories of a mode picker. Index it with the position of a category,
starting at 1, or with its name, to get the colours of that category. The view supports `#`,
`pairs` and `ipairs` over the categories.

<ApiMembers>
  <ApiMember kind="prop" name="ui.ColorCategoryNode[string|integer]" ret="[[{&#x22;s&#x22;:&#x22;ui.ColorsNode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorsnode&#x22;}]]" />

  <ApiMember kind="meta" name="#ui.ColorCategoryNode" syntax="#a" mm="__len" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />
</ApiMembers>

## ui.ColorModes<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;ui.Variable&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]" />

A picker with two or more categories, also called modes. The user switches between them, and
features check `category` to know which mode is selected. Each category has its own colours,
which you address with `value[category][color]`.

<ApiMembers>
  <ApiMember kind="prop" name="ui.ColorModes.categories" summary="The names of the categories. Read only." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorModes.category" summary="The selected category. Reading it returns the position of the category, starting at 1. Assign a position or a category name. Throws an error if the category does not exist." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorModes.default" summary="The default colours, addressed in the same way." ret="[[{&#x22;s&#x22;:&#x22;ui.ColorCategoryNode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorcategorynode&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorModes.raw_value" summary="The overrides, addressed in the same way. Assign `nil` to the field itself to remove all overrides." ret="[[{&#x22;s&#x22;:&#x22;ui.ColorCategoryNode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorcategorynode&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ColorModes.value" summary="The colours of all categories. `v.value['Gradient']['start'] = Color(...)` changes one colour." ret="[[{&#x22;s&#x22;:&#x22;ui.ColorCategoryNode&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uicolorcategorynode&#x22;}]]" />

  <ApiMember kind="type" name="ui.ColorModes.Mode" summary="One mode of a picker that `AddColorModes` created. A mode is a category with its own colours." ret="[[{&#x22;s&#x22;:&#x22;{&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;name&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;icon&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;}&#x22;}]]" />
</ApiMembers>

## ui.ActiveBind<ApiTag label="object type" />

One key bind in the key bind list on the screen.

<ApiMembers>
  <ApiMember kind="prop" name="ui.ActiveBind.is_active" summary="Whether the bind is active now." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ActiveBind.mode" summary="How the bind is activated. `0` is toggle and `1` is hold." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ActiveBind.name" summary="The name of the option that the bind controls, as it is shown in the list." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ActiveBind.reference" summary="The menu control that the bind belongs to." ret="[[{&#x22;s&#x22;:&#x22;ui.Variable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/rendering/ui#uivariable&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ActiveBind.should_show" summary="Whether the bind should be shown in the list." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="ui.ActiveBind.value" summary="The current value of the option that the bind controls." ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" />
</ApiMembers>
