Friday, October 25, 2013

How to create a custom HUD in UDK

UTGFxHudWrapper is the wrapper that deals with the Unreal Script side of the movie or movies ie checks if they are loaded, toggles visibility etc and stores the Class of the MinimapHUDClass in it's Default properties:


GFxMinimapHud on the other hand is the Unreal script that delves deeper into the Flash movie itself:

    TeamStatsMC = GetVariableObject("_root.teamStats");
    PlayerStatsMC = GetVariableObject("_root.playerStats");
It also stores the reference to the actual Gfx movie you want to use in it's Default properties:

To create your own HUD simply extend these two classes and point to your own custom gfx movie

//CWHud .uc
class CWHud extends UTGFxHUDWrapper;

class CWMinimapHUD extends GFxMinimapHud;
The HUD is instantiated inside the PlayerController Class:
//CWPlayerController .uc
CWPlayerController extends UTPlayerController; 

reliable client function ClientSetHUD(class<HUD> newHUDType)
if(myHUD != none)
myHUD = spawn(class'CWHud', self);

No comments:

Post a Comment