Nifty gui hide/show image
Posted
by
Mario
on Game Development
See other posts from Game Development
or by Mario
Published on 2012-11-06T18:10:35Z
Indexed on
2012/11/06
23:21 UTC
Read the original article
Hit count: 212
java
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
© Game Development or respective owner