How to point to file in content in XNA

坚强是说给别人听的谎言 提交于 2019-12-24 04:35:19

问题


I am trying to point to a file in the content of my XNA project. By default the method looks in the bin folder

enigine.play("Sound.wav")

How do I direct it to the content?


回答1:


Use ContentManager.Load<SoundEffect>() method:

var sound = Content.Load<SoundEffect>("Sound");
sound.Play();

where Content is a reference to your ContentManager instance.



来源:https://stackoverflow.com/questions/6103839/how-to-point-to-file-in-content-in-xna

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