

Note the two options for Windows, Windows and WindowsGL. Select Content in the dialog pictured above, then under Platform select the platform you need to build for.

The default import settings for our image are fine, but we need to set the Content build platform. Your content project should now look like: I want the original to be untouched, so I am choosing Copy the file to the directory. When prompted chose the mode that makes the most sense.

Navigate to a select a compatible image file. Let’s add our texture file, simple select Edit->Add->Existing Item… This will open the MonoGame Content Pipeline tool. Simply put, for game assets ( aka, not screen shots, dynamic images, etc ), you should use the content pipeline.Ĭreate a new project, then in the Contents folder, double click the file Content.mgcb. With the release of the content pipeline tool, these methods are deprecated. MonoGame included a number of methods for directly loading content to make up for it’s lack of a working cross platform pipeline. The content pipeline does a lot for you though, including massaging your texture into a platform friendly format, potentially compressing your image, generation of mip maps or power of two textures, pre-multiplied alpha (explained shortly ), optimized loading and more. As of XNA 4, a simpler image loading api was added that allowed you to load gif, jpg and png files directly with the ability to crop, scale and save. I should make it clear, you can load images that haven’t been converted into xnb format. If you’ve been reading since the beginning you’ve already seen a bit of the content pipeline, but now we are going to actually see it in action with a real world example.ĭo we have to use the content pipeline for images? If you’ve got no idea which format to pick, or why, pick png. There are however ways to represent transparency in these other formats, as we will see shortly. Of those three formats, only png and some jpgs have an alpha channel, meaning it supports transparency out of the box. In the “real world” that generally means bmp, jpg or png formats and there is something to be aware of right away. The source image of a texture can be in bmp, dds, dib, hdr, jpg, pfm, png, ppm or tga formats. A texture can generally be thought of as a 2D image stored in memory. As you will quickly discover, this is a more complex subject than it sounds.Īs always, there is an HD video of the content available here.īefore we can proceed too far we need a texture to draw. We are primarily going to focus on loading and displaying textures using a SpriteBatch. Now we move on to a topic that people always seem to love, graphics! In the past few chapters/videos I’ve said over and over “don’t worry, we will cover this later”, well… welcome to later.
