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.
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:
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…
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 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.
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.