jjmontes said:1) What is the difference between <text> and <label>
It's basically the same. The only difference is, that <label> will apply the "nifty-label" style automatically to the element. So when using <label> instead of <text> you can rely on the font attribute being already set. With <text> you'll need to set it manually.
jjmontes said:2.1) How can I make text or images bigger? Is there some 'scale' attribute I'm missing?
You can set the width/height properties to some absolute px value or to some relative percent value as didialchichi explained above.
jjmontes said:2.2) I can use height and width to scale images, but it seems to be relative to the size of the screen. Can I tell Nifty to enforce aspect ratio?
Percent values are always calculated relative to the direct parent element. So if the parent elements resolved width is 100px and you're using 50% for example for a child element width then it will be 50px width.
There is currently no mechanism available to only set the width or the height of an element and let Nifty calculate the other value using the given aspect ratio of some image. What is possible however is to calculate the width or height relative to the other one:
[java] /**
* Add a WIDTH_SUFFIX to some size value to indicate that this value
* will be calculated in respect to the Width of an element. This
* is only appropriate to a height attribute and this class can only
* detect it's present. Handling must be performed outside of this class.
*/
private static final String WIDTH_SUFFIX = "w";
/**
* Add a HEIGHT_SUFFIX to some size value to indicate that this value
* will be calculated in respect to the Height of an element. This
* is only appropriate to a width attribute and this class can only
* detect it's present. Handling must be performed outside of this class.
*/
private static final String HEIGHT_SUFFIX = "h";[/java]
So you can use something like this:
[xml]<... width="50px" height="10%w" ...>[/xml]
or
[xml]<... width="50%" height="10%w" ...>[/xml]
jjmontes said:3) Do I need to write a ScreenController for each screen?
Maybe :)
You could use the same ScreenController for several screens if it is appropriate for your case. If you don't need any interaction on a Screen or if there is no need to do stuff in onStartScreen() or onEndScreen() you can omit a ScreenController and Nifty will create an empty one for you.
jjmontes said:4) Can I make a screen expire? Is there some 'timeout' attribute or other mechanism? (at the time I am using my own timer and calling endScreen() when the timer expires, but this forces me to code that logic outside the xml file).
No, there is no timeout mechanism for this.
jjmontes said:5) My PNG files show upside-down. Any ideas? May the texture transformation GL state be affecting NiftyGUI rendering? Text is always shown correctly.
GL State does influence everything Nifty renderes. It's your job to proper initialize GL for 2d Ortho Mode before calling Niftys rendering method. I don't know right now how the JME2 renderer handles this however.
However upside down images are probably a problem with the JME2 Nifty renderer adapter and not Nifty itself. Images are loaded by the JME2 Nifty renderer. Maybe the code to load images does not read your png files correctly?
jjmontes said:6) I am using several Nifty objects, in a per-gamestate basis. I have use cases where several gamestates are active and rendering Nifty screens (from several Nifty instances) on top of each other (for instance: hud, console, menu ). Is this possible?
Should be possible but the prefered way would be to use different screens for this (maybe using layers) and only using one Nifty instance.