Lets say your GUI uses a logical width and height of 1920x1080 pixels.
Your actual screen width and height can change at any time like when the user resizes the window or changes resolution.
All of the coordinates and dimensions expressed by your GUI code are expressed relative to the logical size and you must do the conversion when you render the textured 2 triangle box.
So you need to do the following:
Compute the ratio of logical width to screen width, and the same for height.
The smallest ratio becomes the zoom factor.
Compute the padding needed to center the GUI.
(this is basically the make-the-image-fill-a-box-and-preserve-aspect-ratio algorithm)
I've implemented it, and I'm drawing it to the screen with identity world matrix.
So basically screen_x = logical_x * ratio;
I haven't figured out the padding yet (i seem to have too much padding)
and the zoom seems to be a bit off when the window is extremely squished into a rectangle.
What irritates me is that I've solved this before but now I can't remember how and I can't find that code from so long ago.