O'Reilly logo

UnrealScript Game Programming Cookbook by Dave Voyles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Drawing text for a player's health

Sure, it's great to have a bar to represent our health, but what if we want something more accurate? It's like reading the gas meter on your car, are you really teetering on empty, or can you push it just a tiny bit longer?

Because I don't condone living so dangerously, I suggest we draw an actual number on screen so that we know exactly how much health we are left with. We're going to take our existing functions and make only a few changes to allow this.

Getting ready

Open your IDE and have your TutorialHUD class available. We're going to make some additions.

How to do it...

For this recipe, we'll take what we learned in our previous recipe and add more functionality onto it. A colored health bar is great, but ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required