I think using a renderTarget is the easiest way then just drawing it to the users screen it will scale everything proportionally.
My question is, how can I do this with matrices in MonoGame.
However some of the other requirements make what your talking about far more detailed and complex.
This part in particular.
If I have three font sizes - small, medium and large, I want to know which one will fit best with the current GUI scale.I want to make sure my textures don't get blurry and my text doesn't get pixelated, garbled, blurry, etc.
You don't even need a matrix to keep the proportional ratio just a vector2 scalar.
However with your stated requirements you cant just trivially make a transformation from one scale to the other. Because any proportional change will skew text which will add a blurred look to it.
What this means is as you have hinted at you need to choose a font size.
However you also still need the propotional scale to find the starting position and ensure that the ending positon doesn't go out of bounds. But this doesn't hold with the requirement as offsets between two starting positions that are proportionally even wont match either with set font sizes. These are basically opposing ideas that counter each other.
This is not something that can simply be solved with a matrix in one shot i think.
Anyways you have to follow a rule. if you want everything to scale proportionally to your design screen.
You have to work from or code in ratios that allow you to convert to and from world space coordinates even your 2d stuff needs to be thought of as going into and back from world space coordinates with a design time ratio that is calculated and wrapped up with the app. That also places certain restrictions on you. Or just store everything in world space coordinates.
However as for text and even images that you dont want the width and height to scale the same, so as to preserve the same quality as you see on your screen then those calculations need to be independant of your design time resolution. It's really a ugly realization.
If you want quality.
Your gui has to look at a resolution in any given situation and decide how do i do it with what ive got.
If you want design time proportion.
You can just renderTarget it, use big text and be done with it, but you get blurred text ect.
I want to know which one will fit best with the current GUI scale
If your storing world space coordinates you just directly convert the positions * by his viewport width height to see which font will best match and choose it. It wont fit exactly though and any scaling is probably going to give it blur.
Ultimately for text you are talking about independant calculations on the users end that you must test with different resolutions to ensure it is satisfactory and this has to be part of your gui design this also has a cost in complexity.
I've been stumped on this for months.
Me too i realized i was stumped on the choice.
It is directly a trade off between quality and a lot of complexity.
Either choice has a high cost, time performance and complexity or quality.