GeonBit.UI: UI extension for MonoGame

Hi Geon,

I’ve updated to the newest version (2.0.1) and the installation went fine with NuGet. I only had to change some stuff like UserInterface now being global, SCALE to GlobalScaleetc. and it ran with no problems.

I think some scale stuff is now handled differently, some buttons are now smaller than others, but I haven’t looked into why yet. Also some text now “runs away” at the beginning, but I’m sure that’s a mistake on my part (both things).

Either way, I think it’s easy to use and works fine.

One little thing: You use enum for almost everything, but when using UserInterface.Initialize(… theme) there is still a string (default “hd”), but without enums it’s hard to know what other themes there are if not looking at the documentation.

Also the shader files for HD and lowres are the same, maybe only having them once might prevent future bugs and save a little space and compilation time.

However, even though I can’t look at the files themselves, since they are “hidden” behind the compiled .dll now by default, i have huge troubles with garbage generation.

I have merely 3 buttons and 3 sliders, but the garbage generated is enormous, and that’s mainly due to using strings to read out configurations.

The last time I checked there was a lot of enums being stringed together and you then compare the string values and look for certain parts to continue.

If that is still the case, and performance profiling suggests it is (most garbage is created somewhere in GetStyleProperty), you could look into encoding these enum combinations differently, maybe in a struct or mini-class that combines several input parameters. Since enums are essentially ints you could also use some decimal or bit encoding / decoding.

1 Like