Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
105 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Introduction
 GUI Controls
 We'll Need

 Breaking It Down
 Static Controls
 Pushbuttons
 Carets and The
 Textbox Control

 Progress Bars
 Sliders and
 Scrollbars

 Listbox Control
 Conclusion

 Printable version

 


  The Series

 Part I
 Part II
 Part III
 Part IV

 

GUI Controls We'll Need

I didn't want to spend a lot of time implementing controls for my game GUI; I wanted to stick with the smallest set of controls that I could. So, I came up with a list of controls that I consider the minimum set for game GUIs:

  • Static Text, Icon, and Group Boxes - vital. These controls label and group the other controls in a dialog box. The static control is crucial; the frame control we could probably live without, but it's fairly simple, and in some cases can go a long way towards making a dialog box easy to navigate, so I'm including it. Icon controls should be simple, but should be able to animate, providing cool background animations in our dialogs and menus (ala Theif: The Dark Project).
  • Buttons and Checkboxes - vital. Weird button types (flat buttons, pushbutton-style radio buttons) we can do without, but most games can't live without a basic button and checkbox.
  • List control - important. I've found list controls, especially multi-column list controls, indispensable when creating game GUIs. They're used everywhere. You're going to want a very intelligent, heavyweight list control, as good or better than the Windows List Control. For me, the list control was the most difficult control to implement.
  • Sliders and scrollbars - Important. Famous for controlling sound and music volume. The bad news is that we'll probably need horizontal and vertical flavors of these guys; the good news is that they're so similar you can implement them very easily.
  • Textboxes - Vital. You have to be able to enter your mega-3l33t, super-kewl player handle somewhere, right?
  • Progress Bars - Essential for displaying hit points, "I'm almost done loading!", etc.

Noticeably absent from this list are the spin button controls (which aren't crucial, and irritate me to no end anyway), radio buttons (we can get by with a single selection listbox instead), and the drop-down combo box (again, we can just use a list box), and tree control. By making the listbox control smart enough to indent certain items, we can incorporate the functionality of the tree control

Tab controls aren't included simply because my game doesn't have enough of a GUI to warrant them, though your needs may differ.

Even with all the omissions, the "minimum" list might seem daunting at first, but we can simplify it quite a bit…


Next : Breaking it down