在XNA中使用system.windows.forms

时间:2021-01-07 20:37:37

I am making a game that uses XNA. I would like to add things to the game such as buttons, textboxes, labels, tooltip texts, and other stuff that comes with system.windows.forms. How do I merge system.windows.forms with XNA? Are there any API's or DLL's that I could implement to get this to work?

我正在制作一款使用XNA的游戏。我想在游戏中添加一些内容,例如按钮,文本框,标签,工具提示文本以及system.windows.forms附带的其他内容。如何将system.windows.forms与XNA合并?我可以实现任何API或DLL来实现这一点吗?

Thanks,

BenShums

1 个解决方案

#1


7  

The bad news: in short, no, it is not possible (at least, in a straightforward way). While it is true that you can use a System.Windows.Forms control as a canvas for your game, you cannot use an XNA device as a canvas for your control.

坏消息:简而言之,不,这是不可能的(至少,以一种直截了当的方式)。虽然您可以将System.Windows.Forms控件用作游戏的画布,但是不能将XNA设备用作控件的画布。

The good news: there are already some alternative toolkits that create textboxes, buttons and labels using XNA.

好消息:已经有一些替代工具包可以使用XNA创建文本框,按钮和标签。

http://forums.xna.com/forums/p/1891/9461.aspx

#1


7  

The bad news: in short, no, it is not possible (at least, in a straightforward way). While it is true that you can use a System.Windows.Forms control as a canvas for your game, you cannot use an XNA device as a canvas for your control.

坏消息:简而言之,不,这是不可能的(至少,以一种直截了当的方式)。虽然您可以将System.Windows.Forms控件用作游戏的画布,但是不能将XNA设备用作控件的画布。

The good news: there are already some alternative toolkits that create textboxes, buttons and labels using XNA.

好消息:已经有一些替代工具包可以使用XNA创建文本框,按钮和标签。

http://forums.xna.com/forums/p/1891/9461.aspx