Currently, I would like to create draggable item icons and slots in my game. However, with Nifty, the default behavior with draggables are that they must actually be dragged with the mouse button held. What I want is that it could be clicked once and be able to be moved around without holding the mouse button. I’ve recently found AbstractController for Nifty, which seemed like something used for custom components. However, I still don’t know how to implement what I wanted with this.
I’ve also wondered if Nifty can do things like custom animation, with very specific actions like spinning buttons. I was easily able to do this with AWT drawing when I was making a 2D game. I doubt that Nifty can do this, but thought I’d ask first before moving on to a different GUI or creating my own.
Am I allowed to plug my own plugin?
There is not an easy way to do this in Nifty from what I was able to tell. I basically ended up copying the nifty drag and drop files and reworking their drag component to get that same functionality. The nifty draggable component works off a mouse down event. I basically reworked it to function on mouse up and keep track of the current item being dragged. Once you look through the code its pretty obvious on how it works.
The custom animation is possible using the niffty effects system but its not very well documented. You would basically need to look at their code for similar effects such as move and create your own patterned off of that. Looking through their source code at how they do things is invaluable when using nifty. A lot of it isn’t documented.
You can easily do this in nifty, extending it with your own effects is not hard and the basics for that are very well documented. The UI system of t0neg0d is in early stages, API changes are unavoidable even if one wants to keep it compatible and by now the code I see doesn’t look much less complicated than Nifty 1.2 code to me… Obviously thats different for the person who wrote it ^^
@normen said: You can easily do this in nifty, extending it with your own effects is not hard and the basics for that are very well documented. The UI system of t0neg0d is in early stages, API changes are unavoidable even if one wants to keep it compatible and by now the code I see doesn't look much less complicated than Nifty 1.2 code to me... Obviously thats different for the person who wrote it ^^
Raowr Ftttt Fttt…
True it is early stages - though the feature-set is more extensive than Nifty.
False in complication… and more so if you have used swing. Imagine creating a UI element and then NOT having to grab a reference to some underpinning element… and one for the screen element… and one for the renderer… and one for the… /boggle
plug +2
EDIT: Give it a try some time… It would take 15 minutes of your life and you might be surprised.
@t0neg0d said: Raowr Ftttt Fttt...True it is early stages - though the feature-set is more extensive than Nifty.
False in complication… and more so if you have used swing. Imagine creating a UI element and then NOT having to grab a reference to some underpinning element… and one for the screen element… and one for the renderer… and one for the… /boggle
plug +2
EDIT: Give it a try some time… It would take 15 minutes of your life and you might be surprised.
I’m no nifty apologist but he’s referring to 1.2 before the API got more complicated.
yep, and as paul already suggested earlier, you are right before the point where you will want to abstract your gui elements further too so you don’t have to change almost all classes each time you want to add a function. Don’t think the ideas of your users will stop Anyway I don’t want to build a GUI right now and I suck in visuals anyway.