Hey i have a problem with nifty-gui. I set up the image select in xml, then redid it in java, in the hope of being able to access methods like getSelectedImageIndex(), however the only methods i can access with the imageSelectBuilder are setImageWidth, setImageHeight and addImage.
[java]
control(new ImageSelectBuilder(“worldChooser”) {
{
setImageHeight(new SizeValue(“80px”));
setImageWidth(new SizeValue(“80px”));
addImage(“Interface/world_materials/hull.png”);
addImage(“Interface/world_materials/grass.jpg”);
}
});
[/java]
How can i access the methods in ImageSelect, instead of the ImageSelectBuilder?
I tried doing this in the screenController:
[java]
cISC = new CreateImageSelectControl();
imageSelect = cISC.create(nifty, nifty.getCurrentScreen(),
nifty.getCurrentScreen().findElementByName(“worldChooser”));
System.out.println(imageSelect.getSelectedImageIndex());
[/java]
This doesn’t work, and creates an extra ImageSelect element