방금 MonoGame을 시작했습니다. 프로그램을 실행할 때마다 자산이 아닌 파일로 오류를로드 할 수 없습니다. 나는 웹을 검색해 왔고 내 문제에 대해서는 아무 것도 발견하지 못했다. 도와주세요!Monogame : 비 콘텐츠 파일로 자산을로드 할 수 없습니다.
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace MoveDemo
{
public class MainGame : Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D mainmenu;
public MainGame()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
mainmenu = Content.Load<Texture2D>("MainMenu");
}
protected override void UnloadContent()
{
}
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
spriteBatch.Begin();
spriteBatch.Draw(mainmenu, new Rectangle(0, 0, 840, 480), Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
}
}
콘텐츠 파이프 라인 도구를 통해 파일을 추가하고 빌드했다고 가정합니다. – Olivier