Sign in to follow this  
murdock

Displaying Table data in an XNA game

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this