UnrealScript Game Programming Cookbook

(Chris Devlin) #1

HUD


200

FinalPos.Y = (Offset.Y < 0 && Height != 0)?
HUDPosition.Y - (Height * ResScaleY) +
(Offset.Y * ResScaleY) :
HUDPosition.Y + (Offset.Y * ResScaleY);

return FinalPos;
}


  1. Let's define a few values in our DefaultProperties block.
    DefaultProperties
    {
    ....
    /* Hit Points /
    // Offsets text from bar
    HPTextOffset=(X=220,Y=0)


// Text scale
TextScale=0.25

// Font used for the text
TutFont="UI_Fonts.MultiFonts.MF_HudLarge"
....
}

The X value in our offset is what offsets the text from our bar. With X set to 220 ,
it will move the text 220 bars over to the right of our current text position.


  1. Compile the code and take a look.

Free download pdf