XNA vs MonoGame GameTime?

Hi,

I have stumbled upon a problem when i created a dll-library in VS2013 with MonoGame.

The code for the DLL:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace AtriLib2.ScreenManager
{
    public class GameScreen
    {
        protected ContentManager Content;
        [XmlIgnore]
        public Type Type;

        public string XmlPath;

        public bool HasTitle;
        public string Title;

        public GameScreen()
        {
            Type = this.GetType();
            XmlPath = "";
            Title = "";
            HasTitle = false;
        }

        public virtual void LoadContent()
        {
            Content = new ContentManager(ScreenManager.Instance.Content.ServiceProvider, "Content");
        }

        public virtual void Unload()
        {
            Content.Unload();
        }

        public virtual void Update(GameTime gameTime)
        {

        }

        public virtual void Draw(SpriteBatch spriteBatch)
        {

        }
    }
}

So now i wanted to test if it was backward compatible, i created a project in VS2010

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
using AtriLib2;
using AtriLib2.ScreenManager;
using AtriLib2.TileMap;

namespace TestGame.Screens
{
    public class GameplayScreen : GameScreen
    {
        Map map;

        public GameplayScreen()
        {
            XmlPath = "Load/Screens/Gameplay.xml";
        }

        public override void LoadContent()
        {
            base.LoadContent();
            AXMLSerializer<Map> mapLoader = new AXMLSerializer<Map>();
            map = mapLoader.Load("Load/Map/Map1.xml");
            map.LoadContent(Content, Game1.monitor.ScreenRectangle);
        }

        public override void Unload()
        {
            base.Unload();
            map.Unload();
        }

// This method gets the error
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (AInput.KeyDown(Keys.W))
                map.Camera.Move(Direction.Up);
            else if (AInput.KeyDown(Keys.S))
                map.Camera.Move(Direction.Down);

            if (AInput.KeyDown(Keys.A))
                map.Camera.Move(Direction.Left);
            else if (AInput.KeyDown(Keys.D))
                map.Camera.Move(Direction.Right);

            if (AInput.KeyPressed(Keys.Z))
                map.Camera.ZoomOut();
            else if (AInput.KeyPressed(Keys.X))
                map.Camera.ZoomIn();
            else if (AInput.KeyPressed(Keys.C))
                map.Camera.Zoom = A2DCamera.DEFAULT_ZOOM;

            map.Update(gameTime);
        }
// This method also gets the error
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, map.Camera.Transformation);
            base.Draw(spriteBatch);
            map.Draw(spriteBatch);
            spriteBatch.End();
        }
    }
}

But in the 2010 project, im getting a ‘No suitable method found to override’
So my question is, is the GameTime object different in XNA 4.0 compared to MonoGames version?

//ZetItUp

What method was it?

As far as we know GameTime is 100% accurate to XNA4.

It’s the Update() method where i am getting the error, it really confuses me.
Can it be that i compiled the DLL in VS2013 and using it in VS2010?

But if what you say, XNA4 GameTime is the same in MonoGame i don’t see a problem :confused:

EDIT:
The project works fine VS2013, all code etc and i use the same code in the VS2010 project, gonna try mess around abit more with it see if i can solve it. :slight_smile:

I also update the entire CS file from the VS2010 project

I Solved the problem, you can delete this post if you like.
What i had done was install VS2010 after MonoGame was installed, thus, i never had the MonoGame templates, so i just created a XNA Framework project, not a MonoGame project. After i reinstalled MonoGame, i got the prjoject to run just fine :slight_smile: Thanks for the reply though!