Which UI for a Code Editor?

Hi guys,

I’m researching whether MonoGame suits my needs for my next game project. I already did a prototype in Godot, but want to detach from their system / editor environement, in which MonoGame seems as a perfect fit for me.

However, my game is about programming, and for that I need to implement a simple UI with a code editor. Nothing fancy, just a multiline textinput, and being able to highlight specific words and characters, maybe even line numbering (not a requirement).

Don’t worry about lexing, regex, etc, I’m handling that myself. Basically just need to color some text in a editable textarea.

I’ve tried out ImGui.NET, but InputTextMultiline doesn’t support coloring words individually, and using/making an extension seems to be a quite complicated matter (At least for a C# dev as me, correct me, if I’m wrong).

Is there any UI frameworks for MonoGame, that can solve my needs? Myra, GeonBit? What are your experiences?

Best regards,

I think there’s a few UI Frameworks folks have made and posted on these forums, you could probably find some with a search. I can’t remember the names offhand though.

One thing to mention though is that ImGui is open source, I believe. If InputTextMultiline doesn’t support what you need, you might be able to modify it to do so. I know you said it might be complex, but I think there might be lots of support for that kinda thing on their git page.

Also, I’ve done a bit of work with ImGui before (not a ton) and I do seem to recall making a text output for a log that supported individual colouring of words. It wasn’t an input box, but I wonder if you could fake it some how by capturing input and just writing it to the text box.

Anyway, good luck!

1 Like