Hey guys! Over the past few weeks I’ve been porting my game, The Peacenet, back to MonoGame from Unreal. Most of it was spent working on the GUI toolkit which is based on MonoGame.Extended.Gui
.
The problem was that I didn’t want to write my own GUI toolkit from scratch or use my old one from 2017 because it drove me to Unreal. I also knew MonoGame.Extended.Gui was unfinished. I decided to work on “finishing” Extended.Gui (or rather implementing a lot of missing features and features I needed for my game specifically) and it’s working pretty well (minus the unfinished text renderer.)
Currently it’s embedded into my Project: Greenlight engine which is inside https://github.com/bitphoenixsoftware/the-peacenet (on the monogame
branch), but a lot of these features may potentially be incorporated into Extended.Gui at some time. So I decided (and @craftworkgames recommended me) to post about it here.
Features
- Skinning: XML-based skinning system. It’s work-in-progress but works with the Content Pipeline and Greenlight’s asset preloader. I’m sure I could untie it from Greenlight if I wrote a custom MonoGame content importer/processor.
- Each control type can be styled based on “style class” (smilar to CSS classes but you can only have one per control), and based on state (default, hovered, pressed, etc).
- Windowing system
- Support for
DynamicSpriteFont
fromSpriteFontPlus.MonoGame
(so you can use TTF fonts in your GUI and change the font size at runtime). - Support for “brushes”, which makes styling and rendering much easier.
- Better layout handling - it’s much easier to tell the layout engine “it’s time to let me re-measure and re-arrange!” - fixing a ton of layout updating issues.
- The Skin can be overridden by the active Screen.
- So much more but most of it is tied to my game.
I was able to create a full-on Linux desktop UI inside this thing, though it’s certainly work-in-progress. I linked my game’s repository above, which also provides a wiki on how to use the GUI system as well as how to mod other areas of the game.