VGUI: Difference between revisions
Appearance
No edit summary |
|||
| Line 44: | Line 44: | ||
} | } | ||
</pre> | </pre> | ||
==HUD Hide flags== | |||
The player has a variable <code>m_iHideHUD</code> that defines which hud elements should be hidden. | |||
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/client/hud.cpp#L948 | |||
Each hud element can asign its self to a hide group using <code>SetHiddenBits(int group)</code>. | |||
There are 3 special hide flags. | |||
* HIDEHUD_ALL is special because it is always asigned to every element. So calling SetHiddenBits(HIDEHUD_ALL) is pointless. | |||
* HIDEHUD_PLAYERDEAD & HIDEHUD_NEEDSUIT are special because it does not use <code>m_iHideHUD</code>. Seem to be a bit of a hack by valve. | |||
Revision as of 11:17, 16 April 2017
VGUI
Borders
DebugBorder2
{
"inset" "0 0 0 0" // margin
"backgroundType" "1" // is of type backgroundtype_e (BACKGROUND_FILLED = 0, BACKGROUND_TEXTURED = 1, BACKGROUND_ROUNDEDCORNERS = 2)
Left // the side
{
"1" // a border can have more then 1 line.
{
"color" "0 255 0 255" // color of the border
"offset" "2 1" // start and end offset. skip the first 2 pixels and skip the last 1 pixel
}
}
Right
{
"1"
{
"color" "0 255 0 255"
"offset" "1 0"
}
}
Top
{
"1"
{
"color" "0 255 0 255"
"offset" "0 0"
}
}
Bottom
{
"1"
{
"color" "0 255 0 255"
"offset" "0 0"
}
}
}
HUD Hide flags
The player has a variable m_iHideHUD that defines which hud elements should be hidden.
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/client/hud.cpp#L948
Each hud element can asign its self to a hide group using SetHiddenBits(int group).
There are 3 special hide flags.
- HIDEHUD_ALL is special because it is always asigned to every element. So calling SetHiddenBits(HIDEHUD_ALL) is pointless.
- HIDEHUD_PLAYERDEAD & HIDEHUD_NEEDSUIT are special because it does not use
m_iHideHUD. Seem to be a bit of a hack by valve.