This project is read-only.

Handling window resizing with Nuclex UserInterface

Nov 24, 2011 at 6:25 PM
Edited Nov 24, 2011 at 6:28 PM

What's the proper way to handle window resizing with Nuclex UI?

If I resize the GUI's screen on window size changing, it makes the spritefont(on things such as labels, choice controls, etc) scale out of proportion compared to the rest of the UI


The other option is not change the GUI's screen, but it makes the UI not resolution independent, and out of position on resizing.


Is there a way to change which spritefont the GUI uses, or change the scale used in the drawstring?

Dec 18, 2011 at 9:37 AM

You can dynamically switch between different themes using sprite fonts of different sizes (like, one for resolutions up to 800x600, one up to 1280x768 and one for higher resolutions), but there's no scaling implemented in the GUI framework itself.

The dialogs, buttons, labels and so on probably resize because they're using fractional coordinates (each position is specified as a fractional part - a percentage of the parent's or window's size - and an absolute part in pixels). If a GUI is built from pixel positions only, it would remain the same size when the Screen resizes (and become smaller relative to the screen as the resolution inreases).