Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm a hobbyist and I've just finished implementing the "game" part of a game I'm developing, and I feel as if it finally matured enough to be worth adding a menu to start a new game, exit, edit options, etc., and so I tried to find sources online with tips for creating menus in XNA (first time creating a game in XNA).

So far, I haven't really found any good solutions. I guess I'm looking for a solution that isn't ad hoc so that I could easily reuse it for future games I decide to make. Is there any such built in XNA functionality I'm unaware of? Any XNA libraries out there that would prove useful? Or do you guys have any tips in general for easy/robust/reusable implementation of menus in XNA?

Thanks in advance!

share|improve this question

1 Answer 1

up vote 8 down vote accepted

You can try Game State Management code sample. I was using it in my first XNA game :)

share|improve this answer
    
+1, that sample is great. –  Jesse Emond May 3 '11 at 21:29
    
Thanks much for the sample! It seems like it will do the job. Just one more question for the moment. . .I've been studying the code, and I eventually came across the use of <code>PlayerIndex?</code>. What does that extra <code>?</code> do? –  Jonathan Gleason May 3 '11 at 22:11
2  
To write code blocks in comments use a backtick (`). The ? is the nullable operator, and allows a value type to be null. msdn.microsoft.com/en-us/library/1t3y8s4s(v=vs.80).aspx –  Olhovsky May 3 '11 at 23:50
1  
@GleasSpty PlayerIndex? playerIndex means that the value of playerIndex (that is of type PlayerIndex enumeration) can be null. –  pek May 30 '11 at 20:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.