简体   繁体   English

在XNA中使用system.windows.forms

[英]Using system.windows.forms with XNA

I am making a game that uses XNA. 我正在制作一款使用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. 我想在游戏中添加一些内容,例如按钮,文本框,标签,工具提示文本以及system.windows.forms附带的其他内容。 How do I merge system.windows.forms with XNA? 如何将system.windows.forms与XNA合并? Are there any API's or DLL's that I could implement to get this to work? 是否有任何我可以实现的API或DLL来实现这一点?

Thanks, 谢谢,

BenShums BenShums

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 http://forums.xna.com/forums/p/1891/9461.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM