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 the player's ammo

We've got a bar to illustrate our current ammo count against our maximum capacity, but it's always useful to see exact values. Therefore we're going to add text for both of these values, similar to how we did it for our health.

Getting ready

Open your IDE and have your TutorialHUD class ready to be altered.

How to do it...

This is going to be very similar to the steps we took in the recipe for displaying an integer to represent our pawn's health. The only major change we need to make here is to the properties that we'll be accessing and using. Rather than displaying our pawn's health, we'll be using the ammo property for our pawn's currently equipped weapon.

  1. Let's start by adding the only variable we'll need for ...

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