This article describes how to use SadConsole from a Visual Studio MonoGame template.
- If you’re using a MonoGame template to create a new project, which auto-generated your
game1code file, follow these steps.
- If you do not have the MonoGame SDK installed, you should create a new blank .NET project by following the directions in the Create a new SadConsole project article.
SadConsole for MonoGame targets .NET 4.6.1. You may use a higher version if necessary.
After creating a new MonoGame project, open the game1.cs or game1.vb source code file
Right-click on the project and click Manage NuGet Packages.
Search for SadConsole.Starter and add it.
If you’re using Linux, NuGet may not setup your project correctly. Look at the folder containing your project. Add any .font and .png as project references and set them to Copy to output folder.
Delete the program-example.cs file.
Open up your
Change the base class from the MonoGame Game class to
public class Game1 : SadConsole.Game
Change the constructor to initialize SadConsole. Provide the font and width/height of the game window in cells.
public Game1() : base("IBM.font", 80, 25, null)
Before anything can be done with SadConsole, the main engine must be initialized. The initialization routine takes a GraphicsDevice reference object.
The following example overrides the
Initialize() method on a Game class:
protected override void Initialize()
This class shows using the SadConsole Engine Component to initialize MonoGame
Now that you have the project created and working, check out the existing tutorials. These will walk you through the basics.