UnrealScript Game Programming Cookbook

(Chris Devlin) #1

HUD


210

{
super.DrawHUD();
DrawHealthText();
DrawPawnNameText();
DrawAmmoText();
}


  1. The final step is to add some information pertaining to our two new variables in the
    defaultproperties block as shown in the following code snippet:
    /* Name /
    /* Corner Position of name text. + / - to X / Y changes
    which corner it is in
    /
    NamePosition=(X=0, Y=0)


// Coordinates for the player name text
NameCoords=(U=0,V=0,UL=0,VL=0)

You'll see that our X and Y value for NamePosition are set to 0. We do this because
we want the name to be centered on the screen and flash with the health and ammo
bars at the top.


  1. Compile the code and yield the results!

Free download pdf