de.lessvoid.nifty.controls.dynamic.ImageCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nifty Show documentation
Show all versions of nifty Show documentation
Nifty GUI is a Java Library that supports the building of interactive user interfaces for games or similar applications. It utilizes OpenGL for rendering and it can be easily integrated into many rendering systems. The configuration of the GUI is stored in xml files with little supporting Java code. In short Nifty helps you to layout stuff, display it in a cool way and interact with it :)
package de.lessvoid.nifty.controls.dynamic;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.controls.StandardControl;
import de.lessvoid.nifty.controls.dynamic.attributes.ControlAttributes;
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.loaderv2.types.ElementType;
import de.lessvoid.nifty.loaderv2.types.ImageType;
import de.lessvoid.nifty.screen.Screen;
import javax.annotation.Nonnull;
public class ImageCreator extends ControlAttributes {
public ImageCreator() {
setAutoId();
}
public ImageCreator(@Nonnull final String id) {
setId(id);
}
@Nonnull
public Element create(
@Nonnull final Nifty nifty,
@Nonnull final Screen screen,
@Nonnull final Element parent) {
return nifty.addControl(screen, parent, new StandardControl() {
@Nonnull
@Override
public Element createControl(
@Nonnull final Nifty nifty,
@Nonnull final Screen screen,
@Nonnull final Element parent) {
return createImage(nifty, screen, parent);
}
});
}
@Override
@Nonnull
public ElementType createType() {
return new ImageType(getAttributes());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy