O'Reilly logo

Beginning 3D Game Programming by Tom Miller

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

Designing the User Interface

Now you need to implement a basic user interface for the few features that you'll be adding to the game (and some that you will add yourself when you finish the game, I hope). Earlier in this chapter, you removed two Dialog variables that were used to make the user interface for the empty project sample. Now you add back a new Dialog variable to create your own user interface:

// User interface for the game
private Dialog gameUI = null;

Of course, you need to instantiate this object somewhere, so find the constructor of the KartRacers class and add the creation code there:

gameUI = new Dialog(sampleFramework);

Regardless of what controls you end up having within this dialog, you need to have it rendered at some ...

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