The easy way is to create a mutator, and register it as a HUD mutator. This allows you to easily
add new stuff to the HUD. However, you will not be able to prevent the normal UT stuff from being drawn.
class SylMutator expands mutator config(SylMutator);
function PreBeginPlay()
{
// You have to register yourself as a HUD mutator like this:
if(!bHUDMutator)
RegisterHUDMutator();
// Other stuff.
}
function PostRender(canvas Canvas)
{
// Draw your stuff.
// Add these lines at the end.
if(HUDMutator != None)
HUDMutator.PostRender(Canvas);
}
The not so easy way is to create your own HUD class, and tell UT to use it. The advantage of doing it this way is you have total control over the HUD. The disadvantage is that there can only be one HUD class, so you could not use any other mutators that are also trying to replace the HUD. Another pain is that there is a different HUD class for each gametype (DM, TDM, CTF, DOM, etc), so you have to make a HUD class for each game type you want to support.
// The UT DeathMatch HUD is the ChallengeHUD class.
class SylChallengeHUD expands ChallengeHUD;
function PostRender(canvas Canvas)
{
// In here you can copy the code from ChallengeHUD, then change it and add new stuff, etc.
}
//////////////////////////////////////////////////////////////////
class SylMutator expands mutator config(SylMutator);
function PreBeginPlay()
{
// Do NOT register yourself as a HUD mutator.
// Instead we tell UT what HUD class we want spawned.
if(Level.Game.IsA('DeathMatchPlus'))
{
DeathMatchPlus(Level.Game).HUDType = Class'SylChallengeHUD';
}
// Other stuff.
}
Any other questions, let me know.