A month ago I have a small diccusion with @void256 about my ideas for Nifty GUI, I’m having my few modifications (few but big changes) from working branches of Nifty gui… even reworking with its philosophy. In which i still concern of the usefulness of it.
Note that: Nifty is very “abstract” in its code base, it’s not as native as Lemur or Tonegod but a service that lend its self for JME3 renderer. So at the end, I want it to be very flexible and useful. Let see if anyone find these changes as “useful” and worthy as I do:
- I let Nifty open its loading process for hooks. So it can let a “Element visitor” and “Type visitor” or listener get noticed when Nifty load its elements and assets.
- I rework the event mechanism, in which an event (generic one not just GUI base event) and flow in Nifty’s EventBus just like what other eventbus do.
- I also add functional flavours with Groovy as shorter builder, setter getter, text templating, element visitors, selectors…
You can see 2) and 3) are my efforts to “bring JQuery and all JavaScript godness via Groovy” to Nifty. So basicly there is something like:
// Setter getter, visitor, selector
GQuery("#playBtn").onClick{
it.text = “Clicked”;
}
// Builder
GQuery.panel{
button(“Hello”)
}
// Text templating
GQuery.panel{
textArea("""
long text
yeah $aVar $withoutAnyQuote
Yeah a newline
“”")
}
- In the mean time, I also try to define something call “Cascade Style Sheet” CSS for Nifty. It is a language which close to CSS (in fact i’ve use CSS parser) and can also be as short as “LESS” (Scriptable CSS). This CSS define style system which are very familiar to web developers and work beside of the current style system. In other hand, it also brings the style selector to Nifty. Note that currently the style cascade scenerio is unclear (current nifty just parse the style and have a string of the style name, not a hierachy of its ancentors), and can CSS hardly be added if I don’t do Point 1).
Currently i’m switching part of my code to lemur and tonegod because of Nifty performance issues in Android (still happen sometimes) but for Desktop Nifty is still my solid choice. I think this should be open to hear your guys opinions, the usefulness of the changes and the ideas if any. Thanks!