Basics: Getting a sprite on the screen

So I used Microsoft XNA a while back, maybe 5 years ago and dabbled around with game dev. I made a crappy little game but it was fun and I’ve wanted to get back into it. I found monogame recently and want to dive right in but having some issues with textures. Back in the day, I could just put a poorly drawn png or whatever in the project directory and load it up no problems, magenta was transparent and it was easy.

After trying that and failing and doing some research, it looks like I need to create .XNB files from all my assets and then there’s this pipeline tool that modifies .mgcb file which I have no idea what that is even after researching it.

If I want to get a ball on the screen what do I do with that image file? I know the code but what are the steps converting that file and getting it to load?

Thanks for any help

Have you got MonoGame 3.4? I’ll explain how to do it in Visual Studio 2010 with MonoGame 3.4. (I’ve figured this much out.)

  1. Open VS2010
  2. New Project C#->MonoGame->MonoGame Windows Project
  3. In your brand new solution, under the “Content” folder, you’ll find “Content.mgcb”. Double-click it. This will open up the new MonoGame Pipeline.
  4. In MonoGame Pipeline, right-click on “Content” and choose “Add->Existing Item”.
  5. Browse to your png file and select “Copy the file to the directory”. This will copy the png file from the source directory into your “Content” folder and set it up for the content build pipeline.
  6. You may now save and close the MonoGame pipeline.
  7. I assume you know how to load and draw a sprite. The content pipeline is pretty much set up and ready to go now.

I have not yet worked out how to publish. So far my published builds contain no content.

Thank you for this guide, I had some problems getting this to work, but after trying to fix it for a while I found that the problem was that double-clicking the content file did NOT open that content file, but rather an older content file that belonged to another program.

It would be nice to be able to drag-and-drop the files into the content pipeline, like you could do in XNA. Hopefully this will be added in a later release!