Load .layout file and apply scaling factor


09-03-2014 16:30:04

For working in iOS, we have a kind of scaling parameter used for Retina displays - e.g. on iPad resolution (as far as Ogre is concerned, iOS manages it differently internally) is some multiple of 1024x768 between 1.0 and 2.0.

I want to build iPad .layout files based on resolution of 1024x768 but be able to load same file even if scaling factor is 1.5 or 1.33 or 2.0. What is the best way to load a .layout file and apply scaling? Are there any built-in tools or is it a case of loading the .layout and iterating the Widgets and explicitly modifying their positions and size?


10-03-2014 12:25:57

Thinking a bit more, if I have widgets with other widgets inside, creating the widget and then scaling it could cause problems with auto-sizing/position. I wonder if to do this safely, we actually need to inject scaling factor inside the layout loading code i.e. before the widgets are created. Then we could also have some more specialised logic like adjusting font size as well?