无法加载content1.png资产非内容文件 [英] Could not load content1.png asset as non content file
问题描述
当试图将图像导入我的'游戏'我得到一个错误信息。在标题中显示的一个。它被称为content1.png并且是在内容的文件夹。我有
When trying to import an image into my 'game' I get a error message. The one displayed in the title. it is called content1.png and is in the Content folder. I have
public override void LoadContent()
{
base.LoadContent();
path = "Content/content1.png";
splash1 = content.Load<Texture2D>(path);
}
和它不会加载它。结果
我。不知道这里做什么
and it doesn't load it.
I have no idea what to do here.
推荐答案
它似乎像 content.Load<的Texture2D>
方法尝试打开从你的文件系统的文件,它不是建立在那里,执行以下步骤来解决:
It's seems like the content.Load<Texture2D>
method tries to open the file from your File-System and it is not founded there, do the following to solve it:
在Visual Studio中 - >右键点击 content1.png
文件 - >选择属性 - >
In Visual Studio -> Right-Click on the content1.png
file -> Select Properties ->
-
将内建动作到
内容
在属性窗口中为
内容1。 PNG
将复制到输出目录以 - > 始终
这篇关于无法加载content1.png资产非内容文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!