What are you guys using for UI? Looking for a simple UI for MonoGame.

Hello there.

I have a simple game here and I’m failing miserably to make a UI for it. Although at the moment the game is planned only for Desktop systems, I’d like to use something that also supports mobiles in case I want to release a demo or just to get used to something I’ll be able to use for other platforms in the future. However, I just couldn’t find anything stable (non-beta), minimalist and simplistic (EmptyKeys for example seems overkill and I hate anything xml :smiley:), I started my own UI but I’ve faced problems like word wrapping and also touch support so I decided to just look better if really there’s no good UI toolkit for MonoGame that fits my needs, I need really basic stuff, image displaying, text with wrapping, button, scrolling widgets. I’ve tried Nez and although it’s also a bit overkill just for a simple UI but I guess it could do, however, I’m having problems with it and already asked on the official thread, maybe that’s the way to go, but is there really no decent UI for MonoGame? I mean, c’mon guys, a UI is pretty much a must-have for any game… is everyone just making their own UI or did I miss something terribly obvious? Thanks in advance.

Btw, this reddit thread sums up my search (not mine): https://www.reddit.com/r/gamedev/comments/4mhwnb/what_are_my_options_for_creating_a_gui_in_monogame/

I’ve another minor question… I heard 3.6 is gonna drop OpenTK in favor of SDL2, is a performance improvement expected? At least for drawing sprites I’ve been having somewhat disappointing performance for DesktopGL compared to XNA4, but even DirectX is much slower. The code is the same and I’ve double-checked the compiler settings. I know cross-platform comes at a cost, but wasn’t really expecting something substantial. Anyway, that’s not important.

I have just used basic scaling rectangles or simple points with radius for user interface.

For things like fonts, I approach them as simple sprites, and just scale them with the screen.
Unless you supply fonts for each supported screen-size, or use vector-graphics, you will need to scale things to some degree.

For menus and stuff, have exported words as pictures, and just used these textures in-game instead of fonts…

My philosophy is, that when the million other things of a game are running and look nice, THEN I can spend any time I want improving font resolutions, for whatever screen sizes your users need.

Thanks for your reply. How do you handle thinks like word wrapping, scrolling and touch input (including for scrolling)? Sure there are other important things but I don’t think a proper UI is asking too much. Any idea if NuclearWinter works with MonoGame? Apparently it supports only FNA and from what I’ve read from the developer, he doesn’t like MonoGame so I’m not confident because I guess I’ll be on my own if bad stuff happens.

word wrapping and scrolling, one simple way would be draw it to a render-target, and then draw only a stencil-rect size of that render-target…

or you can use padding when drawing a string, dynamically changing the pad amount…

1 Like

Hi,

Well, what I can tell you is that I am using my own codebase to have some useful controls. At the moment I only have a button, a textbox and also had a half-implemented popup text area with scrollable, auto-wrapping text and other in-game controls. They were not too difficult to write, though because they were more-or-less test codes, now I am rewriting them into a class library collection. I am not sure whether I will upload them to github or not, because I am not a professional game developer, but I’ll see. :slight_smile:
Anyways, If I can I will help you.

Thank you guys, I wanted something simple for this game and didn’t want to spend much time on coding a UI system (that’s so boring) so I decided to go with another framework (Ultraviolet; it’s awesome)… but thank you nevertheless.

For the tile editor I am making, I skipped the interface, and just use hot-keys and a cheat sheet.

Feeling pretty good about it.

So a little while ago myself and some others did some research into GUI libraries for MonoGame.

The idea was to look at as many existing open source GUI libraries and figure out which ones where candidates for porting or somehow adapting to work with MonoGame. We’ve also been working integrating some kind of GUI functionality into MonoGame.Extended

One of the artifacts of this research was a spreadsheet on google docs containing a list of the libraries we found. I’m sure that alone will be useful to someone reading this thread.

The next thing that’s interesting is that I created a quick and dirty port of Squid. Note that it’s absolutely not finished. It’s in a semi-working state and might be a good starting point if someone wants to go this way.

@Aurioch was also working on porting Nuclex for a while. I’m not sure what state it’s in, but I believe he’s planning on getting back to it at some point.

Last, but certainly not least. I’m still working on the GUI system in MonoGame.Extended based on what I’ve learned from each of these other libraries.

Here’s a sneak peak screenshot of an editor I’ve also been working on. More details about that as I get closer to something usable.

So anyway, that’s that. There’s plenty of activity going on around MonoGame GUI’s. So hopefully there’ll be plenty of options moving forward.

4 Likes

@craftworkgames that’s really nice to hear!

May I suggest a look at NanoVG ?
It’s C code, on top of openGl, so there is quite some work on porting it to C#/Monogame, It’s technically not a GUI system but a vector graphics API based on the Html5 canvas api, and it would be a neat solution.

If I had time this would be something I’d like to spend time on, but I don’t have much these days :confused:

Is the editor using Gemini?

two things

  1. Empty Keys UI is now 2 years and about 8 months old, still active development.

  2. Making your own editor for the UI is the worst decision you can make. Waste of the time, really.

The purpose of the “Age” column in the spreadsheet is to indicate how long since active development. Keep in mind that our original goal was to decide if it was worth pursuing. Knowing how long ago the project was last updated factors strongly into a number of decisions. Knowing when the project was originally conceived doesn’t.

I absolutely agree; if your goal is to make games. My goal is to make game development tools. You seem to share a similar ambition :wink:

Great work on Empty Keys btw. It’s truly a fantastic project :slight_smile: The UI library / editor I’m building takes quite a different approach. I’m sure there’s room in this world for more than one option.

Ah, didn’t notice your question before.

The editor doesn’t use Gemini. I considered / tried using Gemini in the past, but I found it got in the way more than it helped in my particular situation. I’ve had plenty of WPF experience so rolling my own wasn’t a very daunting task.

The main benefit of Gemini is its extensibility orientation, it’s not just an editor but a barebone IDE.
In my opinion, it would be really neat that the Monogame community gets united within a common editor, where anyone could bring its own plugin.
If this is not pluggable, it would be less attractive, in my opinion.

I agree this would be neat. I’ve done some stuff with Gemini before, but I found it hard to get into. Mostly because I had never done WPF before, only WinForms. Also it has a very specific way you’re supposed to use it. When you get used to it all it’s real awesome though :slight_smile:

1 Like

Hello

Just to chim in since I’ve been mentioned.

Regarding GUI, I have just finished porting Nuclex to MonoGame.Extended, so I’m sorta proud to say… we have usable GUI X)

Here’s an example of how it looks (taken from the demo project):

There are still bugs though, and some features may be missing (personally I need the ability to use image as a control’s label instead of text), but I’ll be working on ironing bugs and adding those features - at least until @craftworkgames and others finish with their own GUI.