views:

1543

answers:

5

Hello.

Is there a way to get textboxes, labels and other wpf controls in xna that supports margins, etc that flexes for window size?

+1  A: 

It is possible to embed an XNA game in a WPF form (google: XNA in WPF) if you target only Windows system. You will then have access to all the controls available in XPF for your 2D GUI.

If you also target Xbox 360 or Zune; you must make your own GUI library :(

Jodi
My own GUI library? Piece of cake! Those things can be finished in an afternoon! ;)
Greg D
:) I should add : or use a third-party one. ex: http://www.youtube.com/watch?v=mg9FRFbvte4
Jodi
+1  A: 

Not exactly what you're looking for, but here is an example of getting winforms GUI elements mixed in with XNA 3d content:

http://creators.xna.com/en-US/sample/winforms%5Fseries1

Adam Kane
+2  A: 

You might give CeGui a shot.

If your game needs advanced GUI capabilities, CeGui# might just hit the nail on the head for you. Marketese aside, this is a seriously good GUI library with Buttons, ListBoxes, Scrollbars, ProgressBars, Sliders, ComboBoxes and more.

To access the Xna version you'll need to check out the latest copy from the project's SVN and load up CeGui-XNA.sln.

There are other options listed in this thread, but I have no idea how well any of the others work (and it probably isn't a comprehensive list anymore).

Ryan Versaw
Yea, looks like i'm going to have to go with a 3rd party library for now. I'm using neoforce, found here http://www.tomshane.cz/neoforce/default.aspx
Shawn Mclean
That's looking pretty nice - and actively developed!
Ryan Versaw
+4  A: 

The official GUI systems FAQ thread in the XNA Forum: What GUI systems are there for the XNA framework?

CEGUI# is powerful, but it doesn't support the Xbox 360 (eg. its design doesn't include responding to game pad input) - a major overhaul would be required to refit it to be usable with something else than mouse and keyboard.

Cygon
A: 

Check out SQUID: http://www.ionstar.org/

It's a really clean, fast, and engine independent UI system. I've worked with it extensively and really enjoy using it. The download includes sample code for XNA 3.1, Truevision3D, and SlimDX.

Dan