Hi,
is there any significant difference between using an image or a panel with backgroundImage in the nifty gui ?
What would you suggest to use and why ?
I use for example a âbackgroundImageâ in my WindowBuilder, like this:
[java]
panel(new PanelBuilder(âwinOC_Elementâ) {{
childLayoutAbsolute();
controller(new OperatorControl());
control(new WindowBuilder(âwinOperatorControlâ, âOperatorâ) {{
backgroundImage(panelBackgroundImage);
[/java]
and also in my java class controller I can change this background image, with some code, like this: (this is the backgroundImage for a button, but I guess it is the same for a windowBuilder, because both are âelementsâ
[java]
screen.findElementByName(nameButton).getRenderer(ImageRenderer.class).setImage(nifty.createImage(buttonActive, false));
[/java]
I hope it helps you.
If you are putting other things inside it, use a panel. If not, use an image