Rotation in Nifty GUI

Has anyone done rotation of elements in nifty gui? I would like to make a rotation animation effect, from the very limited info I have been able to find on the web, it is not directly supported by nifty. Does anyone have an idea how to approach it?

Cheers,

NiHal

When Nifty is not enough you should start thinking about using JME Gui 2D.

Translation animations should be supported, if not you can always make your own animations in Nifty.

I don’t mess with images, but it may be possible to rotate the actual image directly (maybe with ImageRaster/ImagePainter?). You’ll probably have to scale it down a bit, so that it still fits inside the original “box” area in nifty, or create a new image out of it, and call parent.layoutElements ()

<cite>@Pixelapp said:</cite> When Nifty is not enough you should start thinking about using JME Gui 2D.

I have not heard of JME GUI 2D? Are you refering to tonegods GUI? I have been considering using that, problem is I have spend alot of time implementing custom controls and controllers, so I would perfer not to change the GUI system, for one functionality. Does tonegodgui support rotations?

<cite>@wezrule said:</cite> I don't mess with images, but it may be possible to rotate the actual image directly (maybe with ImageRaster/ImagePainter?). You'll probably have to scale it down a bit, so that it still fits inside the original "box" area in nifty, or create a new image out of it, and call parent.layoutElements ()
I think repainting the image, is a bit heavy for what is a simple rigid animation. It would also require converting image formats between Texture2D and NiftyImage, which adds even more overhead...
<cite>@normen said:</cite> Translation animations should be supported, if not you can always make your own animations in Nifty.
Yes, the 'move' effect does translations, but nifty seems to make use of no rotation matrix.

Maybe I will just use a simple .gif style animation, using ImageMode:subImage. But painting several frames in PhotoShop is a bit teadious…

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:hud#simple_hudgui_node

<cite>@nihal said:</cite> I have not heard of JME GUI 2D? Are you refering to tonegods GUI? I have been considering using that, problem is I have spend alot of time implementing custom controls and controllers, so I would perfer not to change the GUI system, for one functionality. Does tonegodgui support rotations?

It does… I’ll be updating the base mesh soon(ish) to offset based on origin so you can perform all transforms anchored to the origin you set/change. Not sure when nightlies will show back up, so you’d have to grab this from the repo once it’s committed.

1 Like
<cite>@t0neg0d said:</cite> It does... I'll be updating the base mesh soon(ish) to offset based on origin so you can perform all transforms anchored to the origin you set/change. Not sure when nightlies will show back up, so you'd have to grab this from the repo once it's committed.

That is EXACTLY what i am looking for. Must say I have been considering a switching to your GUI for a while, there are a few things that have been bugging me about nifty ( esp. logging and exception handling ) for a while, maybe I should just give in and start over before it becomes even more work…