New Menu Code

Okay, It’s been busy at home lately. I’ve been moving it. But I’ve been trying to find a little time every day to work on my XNA stuff, and I’ve got a much more complete menu system now.

I’ve made some changes:

- The menu now shows a default “Return” choice at the bottom of each list. This can be turned off by setting the “showBackChoice” boolean.- The menu now has two types of choices, Normal and LeftRight. Normal choice will show their child choices as a separate menu when they are executed. LeftRight choices will show their child choices as a list to the left of the parent choice when they are SELECTED.

I’ve also made the sample code show a bit more info in the console as you are viewing the menu. The sample code initializes the menu as follows:

So there you go. Pretty simple. If I make any more changes, I’ll be sure to post them. Possible changes could be:

- using a proper spriteFont to display the text (so we could use something besides Times new Roman).- making background images actually work.- something I overlooked….

I’ve realized as I’ve been working on this that is might have been easier to just implement it using a full on tree, rather than a bunch of sneaky lists.

This entry was posted
on Sunday, March 30th, 2008 at 12:39 am and is filed under XNA.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

5 Responses to “New Menu Code”

Excellent work Luke!!! I was looking for something like this for a long time.. Can you tell me how can I change the color of my Menu text, something like using some function like color.blue; i know i can make changes to the font library, but I will have to make changes whenever i want to make chagnes to the font. Can you give more options to change the color in the next version Please.. thank you .. Keep up the great work..

I noticed there was a bug with the “return” choice. It was always white text instead of the custom color. I made a quick fix for it and updated the link in the main post, so be sure to download the latest code when you try this out.

Thanks for putting your code up and making it available We've adapted your menu code and are now using it for our university project 'Robot Soccer Visualization'. If you're interested have a look past:http://www.erikson.dk/blog/?cat=18