XNA:在未安装 Game Studio 的情况下动态加载内容?
我想让我的游戏能够在运行时加载内容(例如模型、jpg 文件等)并显示它们。
我查看了 XNA 网站上的示例(http://creators.xna.com/en- US/sample/winforms_series2),但是此方法需要在客户端计算机上安装 Game Studio(也意味着 Visual Studio)。
在没有 VS+GS 的情况下,在运行时加载内容的方法有哪些?我是否必须完全避免 XNA 内容管道?如果是这样,我是否必须编写自己的图形导入库,或者是否有适合此任务的库?
提前致谢!
I'd like to enable my game to load content (such as a model, a jpg file, etc.) during run-time and display them.
I looked at the sample on XNA website (http://creators.xna.com/en-US/sample/winforms_series2), however this method requires Game Studio (which means Visual Studio too) installed on the client computer.
What are the approaches to loading content during run-time without VS+GS? Do I have to to avoid XNA Content Pipeline completely? If so do I have to write my own graphic import library or are there any suitable ones for this task?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要加载纹理,您可以使用 Texture2D .FromFile 方法。
至于模型,我认为没有办法加载它们。如果您只想加载顶点和索引数据,那么将其从文件加载到缓冲区中相当简单。但是,如果您确实想要一个模型实例,那么我没有办法(除了使用内容管道)
For loading a texture you can use Texture2D.FromFile method.
As for models I don't think there is a way to load them. If you just want to load vertex and index data then loading that from a file into buffers is fairly simple. If, however, you actually want a model instance then I know of no way (other than using the content pipeline)
执行此操作需要花费大量时间,并查看目标文件、更改它们,并违反 XNA Gamestudio 3.1 及更低版本的 EULA 中的一些规则。您最好的选择是创建顶点和索引缓冲区,并为模型加载您自己的自定义文件类型。
Doing this would require alot of tweeks, and looking into the target files, changing them, and breaking some of the rules in the EULA for XNA Gamestudio 3.1 and below. Your best bet would be to create Vertex and Index buffers, and loading your own custom file type for models.