Displaying Table data in an XNA game

Started by
2 comments, last by murdock 15 years, 4 months ago
Is there an easy way to display table data in an XNA game? What I want to do is have a table of data where you can sort via a drop down list and then click on each row for more information. I plan on populating this table via an array or other data structure.
Advertisement
No, the XNA framework itself does not have any UI components. You must draw them and respond to mouse/keyboard/controller input yourself.

However, there is at least one UI framework for XNA: http://www.codeplex.com/xnaguilib

But I highly doubt there are any controls that exist that are bindable to a DataSet.
XNA doesn't have anything like that built in (or any other types of controls you might expect from System.Windows.Forms). You'd have to look at other people's free code to see if they've done what you need, OR... write it yourself!

Luckily it's not THAT hard to do what you want. Using the various font measuring functions ling SpriteFont.LineSpacing, SpriteFont.MeasureString, you can determine cell spacing, then if you want to clip text to each cell, you can use the "Scissor Rectangle" functionality.
This is primarily for displaying rosters and statistical data for a football game.

This topic is closed to new replies.

Advertisement