I whenever I change resolution and restart jME (and reshape nifty) all my nifty gui panels are placed correctly. However, I created some BitmapFont texts in an AppState to act as a clock/timer in my game:
[java]
AppSettings settings = new AppSettings(true);
but the problem is that when I update the resolution the txt BitmapFont doesn’t get updated accordingly. Is there any way I could update the setting on it without having to re-assign it a new setting?
The size of the text needs to be proportional to the size of the screen. fnt.getPreferedSize() return a fixed size.
If you designed the screen let’s say in 1280 x 720 you have to compute the size with something like : getPreferedSize/1280*newResWidth.
Note that your font will look a bit blurry after this. You’d better have a bitmap font that is nice and sharp with hi res and reduce the size when the res is lower.
Alternatively you can use a small, medium and large font and change this depending on resolution and avoid any up/down sampling. But you probably won’t notice too much difference than down sampling a high res font. Just letting it out there, as another solution
The issue is not the size of the characters of the text but its location. I am only changing from 950 X 1600 to 650 X 1000 so I can still see the text but in a wrong position.
(There are reasone why most of us use any of the jme based gui librarys, as they do a relayouting in such cases automatically)
While I don’t want to discurage you about writing your own gui librarys, I should say that you can expect it to need around 2-3 years and a lot of rewirtes before the results are what you want them to be quality and performance wise.