XNA books for MonoGame?

I was wondering if it was possible to use books on XNA for MonoGame. MonoGame is an open-source implementation of XNA so in my head it seems possible but I wanted to get a second opinion/thought on it. Has anyone used an XNA book for MonoGame? If so, how did it go?

2 Likes

Hi Fisher!

I’m almost certain that you can use XNA programming books if you plan on making your games in XNA and then bringing them into Monogame . I’m using most of my exact code from my XNA games in MonoGame, and seeing that you currently need XNA’s content pipeline, I would start with XNA first anyway. As far as MonoGame itself, there are plenty of tutorials out there, to get you up in running inside of MonoGame and displaying the classic CornFlowerBlue XNA gamescreen, but you may run into issues inside of MonoGame and want a good MonoGame book, opposed to combing the internet for weeks for a solution.

Awesome. Thanks for answering. Are there any books on MonoGame? I can’t really find any.

It’s too good an opportunity for me to ignore, so excuse the blatant plug for my own book!

“Windows 8 and Windows Phone 8 Game Development” focuses as you can probably guess on using MonoGame for Windows 8 and Windows Phone 8, if either of those platforms are of interest to you? Much of the material is about MonoGame itself so it would have some value for other platforms, but the two Microsoft operating systems are covered in some places too so it’ll be of most use if you’re learning on one of them.

You can find the book on Amazon here:

http://www.amazon.com/dp/1430258365

2 Likes

Oh wow. Thanks. I actually have a Lumia 920 I’ve been thinking about developing for. This might be just what I need.

I’m reading the XNA book from John Pile (http://www.2dgraphicsprogramming.com/) and doing all the exercises in monogame

Hello sir.

Great Place to Ask.

I will do you a favor. I will show you that XNA and Monogames is the
EXACT SAME SYNTAXX

THis is an monogames project from visual studios 2012

#region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using Microsoft.Xna.Framework.GamerServices; #endregion

namespace GameName1
{
///


/// This is the main type for your game
///

public class Game1 : Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;

    public Game1()
        : base()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";
    }

    /// <summary>
    /// Allows the game to perform any initialization it needs to before starting to run.
    /// This is where it can query for any required services and load any non-graphic
    /// related content.  Calling base.Initialize will enumerate through any components
    /// and initialize them as well.
    /// </summary>
    protected override void Initialize()
    {
        // TODO: Add your initialization logic here

        base.Initialize();
    }

    /// <summary>
    /// LoadContent will be called once per game and is the place to load
    /// all of your content.
    /// </summary>
    protected override void LoadContent()
    {
        // Create a new SpriteBatch, which can be used to draw textures.
        spriteBatch = new SpriteBatch(GraphicsDevice);

        // TODO: use this.Content to load your game content here
    }

    /// <summary>
    /// UnloadContent will be called once per game and is the place to unload
    /// all content.
    /// </summary>
    protected override void UnloadContent()
    {
        // TODO: Unload any non ContentManager content here
    }

    /// <summary>
    /// Allows the game to run logic such as updating the world,
    /// checking for collisions, gathering input, and playing audio.
    /// </summary>
    /// <param name="gameTime">Provides a snapshot of timing values.</param>
    protected override void Update(GameTime gameTime)
    {
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            Exit();

        // TODO: Add your update logic here

        base.Update(gameTime);
    }

    /// <summary>
    /// This is called when the game should draw itself.
    /// </summary>
    /// <param name="gameTime">Provides a snapshot of timing values.</param>
    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);

        // TODO: Add your drawing code here

        base.Draw(gameTime);
    }
}

}

this is an xna project from visual studios 2010

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WindowsGame4
{
///


/// This is the main type for your game
///

public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;

    public Game1()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";
    }

    /// <summary>
    /// Allows the game to perform any initialization it needs to before starting to run.
    /// This is where it can query for any required services and load any non-graphic
    /// related content.  Calling base.Initialize will enumerate through any components
    /// and initialize them as well.
    /// </summary>
    protected override void Initialize()
    {
        // TODO: Add your initialization logic here

        base.Initialize();
    }

    /// <summary>
    /// LoadContent will be called once per game and is the place to load
    /// all of your content.
    /// </summary>
    protected override void LoadContent()
    {
        // Create a new SpriteBatch, which can be used to draw textures.
        spriteBatch = new SpriteBatch(GraphicsDevice);

        // TODO: use this.Content to load your game content here
    }

    /// <summary>
    /// UnloadContent will be called once per game and is the place to unload
    /// all content.
    /// </summary>
    protected override void UnloadContent()
    {
        // TODO: Unload any non ContentManager content here
    }

    /// <summary>
    /// Allows the game to run logic such as updating the world,
    /// checking for collisions, gathering input, and playing audio.
    /// </summary>
    /// <param name="gameTime">Provides a snapshot of timing values.</param>
    protected override void Update(GameTime gameTime)
    {
        // Allows the game to exit
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            this.Exit();

        // TODO: Add your update logic here

        base.Update(gameTime);
    }

    /// <summary>
    /// This is called when the game should draw itself.
    /// </summary>
    /// <param name="gameTime">Provides a snapshot of timing values.</param>
    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);

        // TODO: Add your drawing code here

        base.Draw(gameTime);
    }
}

}

so you see it’s the same.

Constructor
Initialize
LoadContent
UnloadContent
Update
Draw

Methods respectable with the same using references in the code

the difference is in the solution explorer MonoGames framework is used besides xna fraomework depending hte project type.

Depending on the version of monogames.
song, or videoplayer.cs is missing respectably