Neo - My little resolution independent GUI project

Hi hi! :wave:t2:

Today I’m feeling proud of how far I’ve gotten with my little GUI “framework” project and want to share.

“Far” is relative of course: to most brilliant minds here this will be underwhelming - and needless to say this has been done before, in better ways - but keep in mind I’m a simple man. I enjoy simple things. :man_mechanic:t2:

No textures involved here (except the one atlas for the MSDF font), just math and shaders.

Here’s the project if someone wants to feel better about their own code:

Thanks for stopping by! :beer:


That’s nice but how are you handling fonts?

1 Like

Thanks @MrValentine ! :pray:t2:

I thought multi-channel distance fields sounded like a good compromise for what I’m doing. I haven’t tried to understand the actual math behind it but works pretty well I think.

@roy-t did a great job writing a monogame implementation (including pipeline importer and processor), although it’s not using an atlas (aka: sending a new texture to the gpu for every glyph) so performance wasn’t so good with lots of text. So I use an atlas instead… :upside_down_face:

1 Like

So, still an image of a font file I assume? anything otherwise will be an issue…

Yeah exactly, but the magic thing is how well these MSDFs scale!

Here is the atlas I’m using in the video above (it’s just 200x200) but the glyphs are totally crisp after lots of up-scaling.


Also kinda like the look of these atlases… might have one printed for the wall. :man_artist:t2:


That’s interesting, thanks for sharing, and yes, it would look cool on a wall…

1 Like

how do you handle other languages? this is something that is very important when making games for other countries and this is something i haven’t found as a simple easy solution yet.

I haven’t thought much about that yet, so not aware of the pitfalls… but I’m sure at some point I’ll regret not having dealt with it sooner. What are some of the biggest problems you’ve run into?

I’m guessing that for all the western languages that use some version of latin script, it’s more of less a matter of including language specific glyphs, and that the difficulty start with languages with a huge number of glyphs like chinese characters?

if you use a spritefont then you need to have one for each language, so loading/unloading can be a mess to manage, also if you want to show all languages in one screen that means having all spritefonts in memory. So i wonder how other frameworks handle this. At least in Unity I saw the localization tool that can help manage all the resources, but in Monogame we do not have anything for that yet.

For all western languages having a single spritefont with all the latin scripts (I tried with english, spanish, french , but I haven’t with russian and others that i do not speak or know ) can be a solution as you mentioned, I tried in the past and so far was working kind of ok, but it won’t work for non latin.

1 Like

Thanks for the shout-out, that was a quick hack to show-case something I also did for a company I worked for. Smart to use an atlas for common glyphs :D. I’ll definitely keep that in mind.

1 Like