Search code examples
c#xnamonogame

Adding content in MonoGame


I'm new to Monogame. I'm trying to add content (An image), but I can't do this. In each tutorial that I have seen, the solution explorer has a folder where I can put assets, but not mine.

I tried to add an image to the root folder, but it doesn't work.

hero = Content.Load<Texture2D>(@"Image1.png");

Solution

  • Right click on your solution and click Add, then New Project.

    From there, select Installed > Visual C# > Monogame, and click on the MonoGame Content Project

    After you do this, you will see your content project in your solution. In order to allow your game to use it, look under your Game project, and right click References. Navigate to Solution > Projects and tick the checkbox next to your Content project.

    You can now add your images to your Content project, and use them like a regular XNA game.

    Check out these links: