I am using Nifty on a JMECanvas with the default styles and controls. There are several issues:
After the application starts, the button targets are a little off, i.e. one has to click slightly beneath the buttons to register a click. This stops after the canvas is resized.
When I resize the canvas, Nifty scales it’s buttons nicely except the button selection overlay. That is, for example (with default styles) I have several grey buttons. After I clicked a button, it is overlayed red. Now this red overlay does not scale when the canvas is resized.
@zarch said:
Have you tried just doing a layoutElements on the while nifty screen?
Just tried calling it from simpleUpdate each frame as a test, but it does nothing. What makes me suspicious is that
After the application starts, the button targets are a little off, i.e. one has to click slightly beneath the buttons to register a click. This stops after the canvas is resized.
hints that there actually is such an update method. Only it is neither layoutElements() nor update().
Well, after messing around a bit on the nifty object to no avail, I just issued a reshape manually.
Anything about the 2nd problem?
When I resize the canvas, Nifty scales it’s buttons nicely *except* the button selection overlay. That is, for example (with default styles) I have several grey buttons. After I clicked a button, it is overlayed red. Now this red overlay does not scale when the canvas is resized.
In nifty there a method that you have to call after resolution has changed, I don’t remember the name of it and I’m about to leave so I can’t take the time to look for it, but it’s definitively there.