XNA and WinForms

元气小坏坏 提交于 2019-12-12 17:32:29

问题


I was wondering If there was a way to have an xna game within a windows forms or in vice versa. I have found several examples online, but I couldn't understand what they were doing. I was also wondering if there was a way to make a sprite act like a button on a winforms...is it possible to click on a sprite?


回答1:


Yes, on all.

Sprite act like a button on winforms: use the onclick event

Xna Game within Windows Forms: You would need to add a reference to the Xna.framework.something ... sorry kinda out of touch which class implements it but a lot of examples on the xna forums by the community It should generate a toolbox control to be able to drag and drop. Example: Nick Gravelyn's Tile Editor... it's youtube based which take you through it step by step.

Winforms into Xna Game: I would say not to rely on adding a winform objects to xna games as it would not always work. e.g: running on xbox360 :D Though, it would be same thing as above for the answer. Examples: Winforms components into xna



来源:https://stackoverflow.com/questions/5317562/xna-and-winforms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!