How can i implement auto scale feature in nifty-gui?

212 Views Asked by At

As I can see in this vimeo video there's a nice feature to scale the whole interface but I cannot find any documentation anywhere telling me how can I do it ( nor in the 1.3.2 manual ).

1

There are 1 best solutions below

0
void256 On

You enable it on the Nifty instance using a "base resolution". This "base resolution" will be used as the inital size of your gui and when it is enabled the actual gui will be scaled automatically to the actual screen resolution:

nifty.enableAutoScaling(1024, 768);

Another way to use it, is to set a "base resolution" and provide the scale factors for width and height directly:

nifty.enableAutoScaling(1024, 768, 2.0, 2.0);

See the Nifty class for reference and there is an example available as well.