Displaying text during runtime
While you're creating your project, one of the things that can be valuable to know is how to give yourself information while the game is going on. This way, you can check the order of the things being called and/or what values data have.
Since it was first written 40 years ago, it has been a tradition for beginning programmers to write a function that displays "Hello World!" on the screen. Let's do that now!
Getting ready
Before we start working on this we need to have a project created and set up. So, follow the previous recipe all the way to completion.
How to do it…
In this recipe, we will extend and customize the built-in GameMode
class to do just that:
With Visual Studio opened, go over to the Solution Explorer tab and open up the
Games/Cookbook_Chapter9/Source/Cookbook_Chapter9
folder, and you should see a number of files. Double-click on theCookbook_Chapter9GameMode.h
file to open it.This file contains the information for a class called
ACookbook_Chapter9GameMode...