About Me

Nothing to see here yet.

Screen Transitions in MonoGame.Extended

This week I worked on simplifying the screen management system in MonoGame.Extended 2.0. The screen management system in version 1 was kinda complicated and a lot of people found it difficult to use. So this time around I decided to keep it super simple. Basic Screens Starting with the base screen class, it’ll feel familiar because the methods match the Game class and behave as you’d expect. public abstract class Screen : IDisposable { public ScreenManager ScreenManager { get; internal set; } public virtual void Dispose() { } public virtual void Initialize() { } public virtual void LoadContent() { } public virtual void UnloadContent() { } public abstract void Update(GameTime gameTime); public abstract void Draw(GameTime gameTime); } Game Screens A common pattern when creating new screens is to pass in an instance of your Game class to the constructor.

A nice clean MonoGame Game class

Whenever I start a new MonoGame project the first thing I like to do is clean up the automatically generated Game1.cs file. It can be quite repetitive after you’ve done this a few times so instead of continuing to do it over and over here it is for easy copy and paste. public class MainGame : Game { private GraphicsDeviceManager _graphicsDeviceManager; private SpriteBatch _spriteBatch; public MainGame() { _graphicsDeviceManager = new GraphicsDeviceManager(this); Content.

Creating custom content importers for the MonoGame Pipeline

A short while ago MonoGame released a Pipeline tool to replace the XNA content pipeline process. The Pipeline tool is reasonably straightforward to use for standard content (textures, sounds, etc) once you get used to it. At some point though, you may want to write your own custom importers, processors, readers and writers for your own or 3rd party content. In this tutorial we’ll create a simple content importer, processor, reader and writer for Bitmap Fonts created with the BMFont tool and use it with MonoGame’s Pipeline tool.