From Valve Developer Community
< Dota 2 Workshop Tools‎ | Panorama
Revision as of 04:39, 16 June 2015 by Ericl (talk) (DOTAUserName)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

An partial list of panel that can be used in Panorama UIs.

You can also use the Panorama Debugger to inspect any existing Panorama UI to see how it was built.


An empty panel. Generally used for hierarchy, layout, or borders. Similar to an HTML 'div'.


A button. Doesn't have any visual elements itself - add child Label or Image, or provide visuals using a CSS background.


<Button id="ShuffleTeamAssignmentButton" onactivate="OnShufflePlayersPressed()">
	<Label text="#custom_game_team_select_shuffle" />
	<Image src="file://{images}/control_icons/shuffle.psd" />


An image. Supports the same file formats that engine textures do. (PNG, PSD, TGA, etc.)


<Image src="file://{images}/custom_game/my_image.png" />
Note:Images live in content folder and are automatically compiled to VTEX_C files in the game tree, so in the example above your PNG should live here: content/dota_addons/ADDON_NAME/panorama/images/my_image.png

Images also support several different scaling methods that determine how the image content is positioned and sized within the panel's bounds:

  • none
  • stretch (the default)
  • stretchx
  • stretchy
  • stretch-to-fit-preserve-aspect
  • stretch-to-fit-x-preserve-aspect
  • stretch-to-fit-y-preserve-aspect
  • stretch-to-cover-preserve-aspect


<Image src="file://{images}/custom_game/my_image.png" scaling="stretch-to-fit-preserve-aspect" />


Text. Supports plain text or HTML. It is highly recommended to place all strings in a localization file so that they can be translated into multiple languages. See the Localization page for details.


<Label text="Hello world!" />

HTML labels support a number of inline tags. Supported attributes include:

  • <b>Bold</b>
  • <i>Italics</i>
  • <em>Emphasis</em>
  • <strong>Strong</strong>
  • <h1>Heading 1</h1>
  • <h2>Heading 2</h2>
  • <br> - newline
  • <p> - new paragraph
  • <li>List Item</li>
  • <a>Anchor</a> - supports several attributes. Theses attributes can be a website link (e.g. ""), a panorama event (e.g. "event:AddStyle( MyCustomClass )"), or a javascript function (e.g. "javascript:DoSomething()".
    • href - triggered on clicking the anchor
    • onmouseover - triggered on mousing over the anchor
    • onmouseout - triggered on mousing off of the anchor
    • oncontextmenu - triggered on right clicking the anchor
  • <img src="file://{images}/custom_game/my_image.png">
  • <span class="MyCustomClass">Some Text<span> - preferred way to have different formatting on text ranges within a label. The class referenced is loaded from the CSS file associated with your XML file. You can also place class="MyCustomClass" on the other range tags (e.g. <b>, <i>, <a>)
  • <font color="#ff0000">Some Red Text<font> - supported, but generally a better practice to use a span with a class.


<Label html="true" text="Click &lt;a href=&quot;;&gt;here&lt;a&gt;" />


A user-editable text box.


<TextEntry id="MyEntry" maxchars="100" placeholder="Type here..." oninputsubmit="OnSubmitted()" />


A control to pick among a set of options.


<DropDown oninputsubmit="OnDropDownChanged()">
  <Label text="Entry 1" id="entry1"/>
  <Label text="Entry 2" id="entry2"/>
  <Label text="Entry 3" id="entry3"/>
  <Label text="Entry 4" id="entry4"/>
Note:Each element in the dropdown must have a unique id.


A button that toggles its selected state on/off when clicked. Often represented as a checkbox.


<ToggleButton checked="true" text="Checkbox 1" />
<ToggleButton text="Checkbox 2" />


A button is part of a group of buttons, of which only one is active at a time.


<RadioButton checked="checked" group="Demo" id="Demo1" text="Radio button 1"/>
<RadioButton group="Demo" id="Demo2" text="Radio button 2"/>
<RadioButton group="Demo" id="Demo3" text="Radio button 3"/>


A version of the Image control that automatically displays a hero image.

You can control which hero to display by either setting the heroid or heroname property.

There are three styles of hero images that can be picked using the heroimagestyle property:

  • landscape - 128x72, used in the scoreboard.
  • portrait - 71x94, used in the hero selector.
  • icon - 32x32, used on the minimap.


<DOTAHeroImage heroid="5" />
<DOTAHeroImage heroname="npc_dota_hero_nevermore" />
<DOTAHeroImage heroname="npc_dota_hero_pudge" heroimagestyle="portrait" />


Displays the steam avatar for a user's steamid.

Use steamid="local" to represent the local player, or a full 64-bit steamid to represent any other user.


<DOTAAvatarImage steamid="local" />


Displays the steam username for a user's steamid.

Use steamid="local" to represent the local player, or a full 64-bit steamid to represent any other user.


<DOTAUserName steamid="local" />