XNA Essentials

Game Programming for Xbox 360, PC + Windows Phone


Chapter 20 problem?

I'm on chapter 20 and am trying to work through the transitions demo but ran into a problem.  In the UpdateInput() method, the first if-statement references InputHandler.ButtonType.A.  I'm not able to find where this is defined in the XELibrary.  I tried looking in the Chapter 20 XELibrary code that's on the CD and it wasn't in there either.

As a last resort, I tried copying the whole Chapter 20 folder to my desktop then opening the solution file for the Transitions Demo and even then it won't build, it says ButtonType is undefined in InputHandler.  Am I missing something?

NicolasX - Wednesday, August 4, 2010 @ 8:11 PM

Re: Chapter 20 problem?

I'll update the errata to include this same fix for Chapter 20, but you can grab the Chapter9 fix code and that should correct it.  I'm not near the code currently and can't confirm if that is all that is needed, but basically anywhere you see "InputHandler.ButtonType." replace it with "Buttons."
Info from errata page:
"With the change from XNA Game Studio 1.0 Refresh to XNA Game Studio 3.0, Microsoft included a enumeration type for buttons. In the original book we created our own type InputHandler.ButtonType. The built in enum type is simply Buttons. In the Game1.cs files for both the Sort Order Demo and the Progress Bar demo both reference the custom enum type which does not exist in the XELibrary code. The code should reference Buttons instead of InputHandler.ButtonType. "


Chad Carter - Friday, August 6, 2010 @ 5:14 PM

Re: Chapter 20 problem?

Also needed for Chapter 22.  I haven't read the later chapters yet, so don't rule out the need in more chapters?

PhilBell - Tuesday, August 17, 2010 @ 5:24 AM