HUD - FreeSlave/halflife-featureful GitHub Wiki
Wiki is deprecated. Proceed to GitHub pages!
This page describes various HUD features added in Half-Life Featureful SDK.
HUD scaling
HUD scales depending on the hud_scale cvar. The value 1 means default rendering (no rescaling). The value 0 means autoscaling - the effective scaling will be chosen depending on the screen resolution.
Notes:
- Rescaling is not available in Software Mode.
- Xash3D has its own engine-side
hud_scalecvar. If the engine provides its own cvar, the game library doesn't create one and relies on the default sprite rendering. - HUD scaling is not the same as high resolution HUD added in Half-Life anniversary update. Support for larger HUD sprite resolutions will be added to the codebase later.
images/opfor.png images/cstrike.png Night vision
See Nightvision.
Drawing armor icon next to health
The cvar hud_armor_near_health lets user to choose whether the armor should be drawn near the health like in HL 25 anniversary.
images/decay.png Move mode
An icon that shows the current movement state of player like in PS2 version of Half-Life. In order to enable this icon:
- Set
movemode.enabled_by_defaultto true in features/featureful_client.cfg or setmovemode.configurableto true. In the latter case whether the icon will be shown will depend on the value of thehud_draw_movemodeclient cvar. - Add
mode_stand,mode_run,mode_crouchandmode_jumpsprite definitions in sprites/hud.txt. These should refer to the sprite file in your mod and describe the dimensions.
Example (considering the sprite is at sprites/hud_mode.spr)
mode_stand 640 hud_mode 0 0 32 32
mode_run 640 hud_mode 32 0 32 32
mode_crouch 640 hud_mode 0 32 32 32
mode_jump 640 hud_mode 32 32 32 32
Don't forget to increase the value at the beginning of the file by 4! (because we added 4 lines)
Configuring HUD color
Default HUD color is set by hud_color feature in features/featureful_client.cfg. Default HUD color when the player is low on health is set via hud_color_critical feature.
There's also a client command hud_color available for a user to customize their HUD color (but only when hud_color.configurable is set to true).
E.g. hud_color 0 160 0 sets the HUD color to green.
hud_color default resets the color to the default value.