【发布时间】:2023-03-13 18:31:01
【问题描述】:
我几天来一直在与这个问题作斗争,浏览网络,但没有任何帮助我解决它:我正在 Visual Studio 2012 上创建一个 MonoGame 应用程序,但是在尝试加载纹理时,我得到以下信息问题:
无法加载菜单/btnPlay 资源!
我已经设置了内容目录:Content.RootDirectory = "Assets";文件 btnPlay.png 还设置了属性:构建操作:内容和复制到输出目录:如果更新则复制。
我的构造函数和 LoadContent 函数完全是空的,但你自己看看:
public WizardGame()
{
Window.Title = "Just another Wizard game";
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Assets";
}
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
_spriteBatch = new SpriteBatch(GraphicsDevice);
Texture2D texture = Content.Load<Texture2D>("Menu/btnPlay");
_graphics.IsFullScreen = true;
_graphics.ApplyChanges();
}
我很乐意提供任何帮助!我对这个问题完全绝望....
【问题讨论】:
标签: c# visual-studio-2012 xna monogame