HUD gotchas
Panorama looks like HTML and CSS, but it’s its own engine, and custom_hud_layout allows only a small part of it. Most of what goes wrong fails without an error: the layout doesn’t appear, or a property does nothing.
Each item is marked by where it comes from:
- Valve: stated in
point_script.d.tsor shown in Valve’scs_script_demoaddon. - Reported: written up by community authors from their own testing, and not yet confirmed here. The sources are cs2-ui-kit’s GOTCHAS.md, PanoramaHUD-Skills’ runtime notes and cs2-challenges’ Panorama CSS notes. If you’ve confirmed or disproved one, a change to this page is welcome.
Markup
Section titled “Markup”- Valve: the allowed elements and attributes are listed under What a layout may contain.
- Reported: one disallowed panel type or attribute stops the whole layout from loading.
style,hittestchildrenandscalingare all rejected. - Reported: the root panel may not have an
id; the resource compiler refuses the file. Put the id on a panel inside it. Valve’s demo root has only aclass. - Reported: because the root is always visible, hide and show a panel inside it, never the root itself.
- Reported:
hittest="false"on every panel that isn’t meant to be clicked keeps clicks from landing on decoration. While input capture is on, clicks on empty space can reach the stock HUD underneath, such as the buy menu.
- Valve: styling with CSS is supported. Valve’s demo stylesheet uses
flow-children,horizontal-align,&.Classnesting,&:hover,transition-propertyandtransition-duration, and eight-digit hex colours such as#000000ee. - Reported: web layout and value syntax are dropped without a warning:
display, flexbox,rgba(),calc(),var(),@media,::beforeand::after. Lay out withflow-children: down | rightandhorizontal-align/vertical-align, and write colours as hex. - Reported:
background-size: containis spelledcontainsin Panorama. - Reported:
box-shadowtakes the colour first. - Reported: panels never wrap, and a
width: 100%child of a parent with no size renders as nothing. Give containers a size. - Reported:
background-blurdoes nothing;world-blurblurs the game behind a panel. - Reported: transitions on
opacityandtransformwork. Animating height or anything that reflows the layout doesn’t.
Classes and dialog variables
Section titled “Classes and dialog variables”- Valve: how the
ForPlayermethods override the all-player value and fall back to it is under Driving it from script. - Valve: the seven
HUD_*_VISIBLEclasses the game sets while stock UI is open are listed under What a layout may contain. A selector such as.HUD_SCOREBOARD_VISIBLE #minereacts to one. - Reported: the dialog-variable syntax for a Label’s
textis under What a layout may contain. Valve’s demo doesn’t use it; community layouts such as cs2-ui-kit’s example menu do. - Reported: class changes reach clients as a difference from the last state, so removing and re-adding a class in the same tick sends nothing. To replay an animation, remove the class and add it back on a later tick, or alternate between two class names.
- Reported: setting a dialog variable restarts any
widthtransition in the same part of the layout. Build bars from fixed segments, or withclip: rect(). - Reported: each
custom_hud_layoutcan intern at most 1024 distinct ids, class names and variable names.
Images
Section titled “Images”- Reported: the server can’t change an
<Image>’ssrcat run time. To switch images, put each as abackground-imageon a class and toggle the class. - Reported: game assets resolve through
s2r://, for exampleurl("s2r://panorama/images/icons/ui/expand.vsvg"). An addon’s own images go underpanorama/images/custom_game/. - Reported: a stock
.vsvgused directly as an<Image src>has broken layouts; using it as a background works.
Layering and players
Section titled “Layering and players”- Reported: only
z-index: 99999on the outermost panel puts a layout above the stock HUD. - Valve: input capture freezes the player until every layout has released it. Release it wherever you close the UI.
- Reported: state is kept per slot, and a slot is reused by the next player to connect. Clear a slot on disconnect with
ResetForPlayer, or hide per-player panels on spawn. - Reported: the
custom_hud_layoutentity outlives a server plugin reload, along with the classes and variables already set on it. Whether a map script’s hot reload in Tools mode behaves the same hasn’t been checked; resetting what the script owns on load is safe either way.