Writing a scaling interface


#1

How do you guys go about programming a scaleable interface? Do you design your interface at a default size and add a “scaleFactor” variable to every fixed number? Or do you write the interface such that everything is defined with a float between 0 and 1 and the whole interface is built around multiplying this value by getHeight() or getWidth()?


#2

Do something like:

setTransform(AffineTransform::scale(interfaceScale));

That won’t take care of popup menus (including combo box popups). Just scale your popup Font in LookAndFeel appropriately.


#3

Thats not quite what i mean. I mean that i could define my entire interface using ratios that multiply against getwidth() and getheight() or i could write it all defined to a fixed size (like 800x400) for dialing in placement and then use a scaling variable multiplied by all of the fixed values used in the fixed size. Which approach would you do?


#4

I use ratios


#5

I second the use of ratios.


#6

ratios it is! Thanks guys


#7

Are you aware of the built in
Desktop::getInstance().setGlobalScaleFactor (ratio)
?


#8

I use XML defined layouts:


http://ffAudio.github.io/ffLayouts/
:wink:
EDIT: updated the links…