CustomHudLayout
Exported class in cs_script/point_script. experimental
CustomHudLayouts (custom_hud_layout) are the entry point for scripted maps to provide custom UI.
* Supported panel types and attributes are:
* <Panel> with attributes id, class and hittest
* <Label> with attributes id, class, hittest, and text
* <Image> with attributes id, class, hittest, and src
* <Button> with attributes id and class
* Styling with css is supported.
* The following css classes will be set on an ancestor panel when appropriate:
* HUD_TEAMINTRO_VISIBLE
* HUD_BUYMENU_VISIBLE
* HUD_SCOREBOARD_VISIBLE
* HUD_WINPANEL_VISIBLE
* HUD_ENDOFMATCH_VISIBLE
* HUD_TEAMMENU_VISIBLE
* HUD_CHAT_VISIBLE
* Events and client side scripting are not supported.
To use
* Add a panorama layout .xml file under "panorama/layout/custom_game" in your addon
* Add a custom_hud_layout point entity to your map and point its layout property at your .vxml asset.
* See example addon cs_script_demo
* There is a custom_hud_layout entity in the cs_script_demo.vmap named "welcome_layout" that displays "panorama/layouts/custom_game/welcome.vxml".
* It also references css file panorama/styles/custom_game/welcome.css. (vcss is the asset extension)
* The layout begins with a "Dismissed" class on the Panel with id "dialog" which is then removed in cs_script file "maps/scripts/setup.js".
Experimental: This feature is experimental and may experience breaking changes. Please send feedback to CSGOTeamFeedback@valvesoftware.com with "cs_script Feedback" in the subject line.
- Extends
Entity; inherited members are on those pages. - Returned for classnames
custom_hud_layout.
CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2 · engine class CCSCustomHudLayout
Members
SetHasClass
SetHasClass(panelId: string, className: string, hasClass?: boolean): voidSet if a panel has a class. Applies to all players.
Omit hasClass to revert to the original value.
SetHasClassForPlayer
SetHasClassForPlayer(playerSlot: number, panelId: string, className: string, hasClass?: boolean): voidSet if a panel has a class for a single player. Will override the all player value.
Omit hasClass to defer to the all player value.
SetDialogVariableString
SetDialogVariableString(panelId: string, variableName: string, value: string): voidSet the value of a dialog variable. Applies to all players.
SetDialogVariableStringForPlayer
SetDialogVariableStringForPlayer(playerSlot: number, panelId: string, variableName: string, value?: string): voidSet the value of a dialog variable for a single player. Will override the all player value.
Omit value to defer to the all player value. If no all player value has been set, the value will be an empty string.
SetInputCaptureEnabled
SetInputCaptureEnabled(playerSlot: number, enabled: boolean): voidSet to true to force a player into cursor mode and enable click detection on the panels of this layout.
Set a callback with Instance.OnCustomHudClicked to listen for clicks.
Multiple CustomHudLayouts can have input captured at a time.
Players will get movement control back once all CustomHudLayouts have disabled input capture.
IsInputCaptureEnabled
IsInputCaptureEnabled(playerSlot: number): booleanGet if this CustomHudLayout is capturing input for a player
Reset
Reset(): voidReset to original state for all players.
ResetForPlayer
ResetForPlayer(playerSlot: number): voidReset a single player's overrides to their original state.