MonoGame.Forms increase default Font size or load new Font


Using Visual Studio 2022 C# with MonoGame.Forms

I am just getting started with MonoGame.Forms. I want to make an about box for my application that has a bit of bling. To start, I want to make an old school scroller that scrolls text from right to left along the bottom and then repeats. This was pretty easy to get going using:

Editor.spriteBatch.DrawString(Editor.Font, WelcomeMessage, new Vector2(xxx,500),Color.White);

and it scrolls very smoothly. The issue I am having is that the default font size is too small and not bold. I would like to have the font larger and bold.

Following ReBuff’s guide here:

I was able to get the MGCB editor working and can add a font to the content folder. The problem now is loading the new font into MonoGame.Forms. All of the tutorials I have found uses the:

font = Content.Load<SpriteFont>("Arial20");

The method, Content.Load is not available in MonoGame.Forms, at least I am not able to make it work.

So my questions are:
How can I increase the font size of the default Font used by Editor.Font?
How can I load a new Font and use it with DrawString?

Thank you for your time!

You can do pretty much anything that MonoGame can do by using the Editor property inside your game time control.

consolas20 = Editor.Content.Load<SpriteFont>("Consolas20");

Basically, if you want to access the Sprite Batch or Content or anything else that is usually in the Game class, just type “Editor.” before it.

I’m glad my guide helped you, hope this helps you too!

Hello ReBuff,

Thank you very much, that worked!


1 Like