• Advertisement
Sign in to follow this  

Displaying Table data in an XNA game

This topic is 3358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement