Publishing on Linux... Yes or No?

@pspeed said:
Regular fonts scale in JME. This was a limitation of Nifty itself but some time back nifty added the ability to scale the whole UI... which makes the most sense in these cases.

That's fabulous!
I didn't notice that update, but testing it out just now it seems to work great.
1 Like

I need to update jME for it to work? I tested using BitmapFonts and the fonts didn’t scale.

Haha oh memonick, you really crack me up XD



You always make yourself problems where there aren’t any… you get the OS compatibility for free. The only thing you have to keep in mind is paths, so use File.separator when creating directory strings. And that piece of code I gave you is when you set fullscreen by hand, OSX apparently expects a frequency of 0. But that is all! And if you don’t have to set JVM parameters, you can just spread your .jar + libs + data without OS specific bundles.



And OSX is actually pretty good for testing, because it has a strict shader compiler and crappy-slow graphics drivers so if it works on Mac, it works everywhere :smiley:



Now I will hijack this thread, @pspeed: How exactly is this scaling working? Do you have a link? I need that text scaling very badly and don’t want to use 5 different font files that just differ in their character size…

@Dodikles said:
Now I will hijack this thread, @pspeed: How exactly is this scaling working? Do you have a link? I need that text scaling very badly and don't want to use 5 different font files that just differ in their character size...


You mean in nifty or JME?

In JME, if you have BitmapText you can just setLocalScale() on it.

Erm, I mean the opposite. Nifty, that is… :stuck_out_tongue:

Its something simple like nifty.setBlahScaling() or nifty.getRenderer().setScaling… It should be in the latest stable too.

[java]nifty.getRenderEngine().enableAutoScaling(baseWidth, baseHeight);[/java]

or

[java]nifty.getRenderEngine().setImageScale(scale);

nifty.getRenderEngine().setRenderTextSize(scale);[/java]

It works ok, but as you might expect, resizing bitmap fonts too much might not look as good as you want.

The best approach might be to just create your user interface to use relative layout positions and sizes and only rescale the text if really necessary. If possible, you could also let the user resize GUI elements. If it’s not a too complicated interface I doubt it would be a problem.

1 Like