Nifty gui hide/show image
- by Mario
I have a simple screen made with Nifty gui. On this game screen I want to put a simple image controls sound: just on and not.
So I have two images to switch and get music stop or run.
Problem is: how can I hide/disply an image with nifty gui?
Here my java code when player click on image:
Screen screen = nifty.getCurrentScreen();
Element el = screen.findElementByName("iconOn");
el.setVisible(false);
el = screen.findElementByName("iconOff");
el.setVisible(true);
This code doesn't work :(
Thanks to everyone could help me