I just recently installed MonoGame.Extended v0.6.266 beta because I needed some functionality that wasn't in v0.5 official. However, I noticed that the draw() method for TiledMap.cs has been removed. This is also the case for TiledLayer.cs. So my question is how do I draw the map and its layers? And I know that this is not an issue with the the way I installed the beta, because I scanned through the source files on the GitHub repo and saw that draw() was indeed removed.

  • You will probably get a faster and more accurate response if you contact the creator of Monogame.Extended directly. – Honeybunch Jan 13 '17 at 0:11
  • 1
    @Honeybunch I'm always keeping an eye on stack :) I quite like it when questions show up here. We also have a number of other ways to get help though. A popular one is using the gitter chat room – craftworkgames Jan 13 '17 at 11:46
up vote 4 down vote accepted

I'm the creator of MonoGame.Extended ;)

Quite a lot has changed since the 0.5 release. We've been working heavily on the Tiled renderer to solve some memory and performance issues and make it possible to customize the rendering process so that it's more useful in actual games.

Some of this work is still in progress, so be aware that the following code is likely to change again in the near future. We do try to keep the demo updated with the latest changes.

As it stands today, the current way to render Tiled maps is to use the FullMapRenderer. The idea is to separate the rendering from the map itself, so that maps can be swapped in and out, and the renderer can be customized.

First you create a renderer in the Initialize method.

_mapRenderer = new FullMapRenderer(GraphicsDevice);

Then you can load and assign the map to the renderer in LoadContent.

_tiledMap = Content.Load<TiledMap>("my-map");
_mapRenderer.SwapMap(_tiledMap);

Finally, you can update the renderer (for tile animations) in the Update method.

_mapRenderer.Update(gameTime);

And of course, draw the map in the Draw method.

_mapRenderer.Draw(_camera.GetViewMatrix());

I hope that helps. As I said, things will change but hopefully you can appreciate the improvements we're trying to make.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.