XNA and GUI controls (eg. xaml and xna)

2019-02-16 19:34发布

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

5条回答
We Are One
2楼-- · 2019-02-16 19:47

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

查看更多
迷人小祖宗
3楼-- · 2019-02-16 19:49

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.

查看更多
啃猪蹄的小仙女
4楼-- · 2019-02-16 19:55

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

查看更多
虎瘦雄心在
5楼-- · 2019-02-16 19:58

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_series1

查看更多
可以哭但决不认输i
6楼-- · 2019-02-16 20:06

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.

查看更多
登录 后发表回答