How to use FullMapRenderer in project?

I’m trying to use the class FullMapRenderer, but when I reference it in my code, I get an error stating that the type or namespace could not be found:

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

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

using MonoGame.Extended.Maps.Tiled;

namespace Catmakesgames.Samples
{
    class Dungeon
    {
        protected TiledMap map;

        protected FullMapRenderer fullMapRenderer;

        protected Microsoft.Xna.Framework.Content.ContentManager Content { get { return Game1.ContentManager; } }

        public Dungeon(string mapAssetName)
        {
            map = Content.Load<TiledMap>(mapAssetName);
        }
    }
}

So, I assume it’s in different namespace other than MonoGame.Extended.Maps.Tiled (I don’t see it in the object browser)

So, what namespace do I have to include in order to use FullMapRenderer? Is there another assembly I need to pull in?

@craftworkgames Looks like the there needs to be a Nuget package for the separated code

It was solved in this GitHub issue. I installed the MonoGame.Extended.Tiled package (I only had MonoGame.Extended installed previously), and it’s working fine now:

Thanks to everyone who helped with this!

@Sopheria Glad it is working for you now. Also while documentation is lacking, the best place to learn how things work with MG.Ex right now is through the demos. There is a Tiled demo which shows exactly how to load and render a Tiled map in game.

Now there’s another problem. (To preface, I looked through the demo code to see what was wrong, but it seems like it has more to do with the MonoGame.Extended.Content.Pipeline.dll binary that I’m using in my project, though I could be wrong on that).

using System;

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

using MonoGame.Extended.Tiled;
using MonoGame.Extended.Tiled.Renderers;

namespace Catmakesgames
{
    class Dungeon
    {
        protected TiledMap map;

        protected FullMapRenderer fullMapRenderer;

        protected ContentManager Content { get { return Game1.ContentManager; } }

        public Dungeon(string mapAssetName, GraphicsDevice graphicsDevice)
        {
            Content.Load<TiledMap>(mapAssetName);

            //fullMapRenderer = new FullMapRenderer(graphicsDevice);
            //fullMapRenderer.SwapMap(map);
       }
    }
}

The using statement using MonoGame.Extended.Maps.Tiled has now been replaced with using MonoGame.Extended.Tiled. But Content.Load<TiledMap>(mapAssetName); is now throwing a System.InvalidCastException, with details:

Additional information: Unable to cast object of type 'MonoGame.Extended.Maps.Tiled.TiledMap'
to type 'MonoGame.Extended.Tiled.TiledMap'.

The exception is coming from within the Content.Load method, so my thought was that the TiledMapReader is still using the old namespace, MonoGame.Extended.Maps.Tiled (but again, I could be completely wrong, these were just my thoughts as I tried to figure this out on my own). Anyone know why it’s throwing this exception?

The namespace MonoGame.Extended.Maps.Tiled no longer exists in the head branch. Do you have a mismatch of libraries?

It sounds like there’s a version mismatch between the MonoGame.Extended.Content.Pipeline.dll and the MonoGame.Extended.Tiled.dll.

These need to be the same version.

Thanks! I ended up just imported those packages from the repository directly (from my file system), instead of loading them with NuGet. When I tried to install that version with NuGet, I got errors saying version 1.0.0.0 wasn’t found.

Install-Package -Source http://build.craftworkgames.com/guestAuth/app/nuget/v1/FeedService.svc/ -IncludePrerelease MonoGame.Extended.Tiled -Version 1.0.0.0

But it worked when I imported them from the file system, and I’m now able to render the map as expected.