hello,
I try to implement a custom effect, it works nice,
but is there a way to provide the current screen to the effect???
so far I have to use a global static variable
public class CustomEffect implements EffectImpl
{
private static Screen screen;
public static void Init(Screen _screen)
{
screen=_screen;
}
public void activate(final Nifty nifty, final Element element, final EffectProperties parameter)
{
String state = parameter.getProperty("state");
if(state!=null)
{
Element background=element.findElementByName("#background");
NiftyImage image = nifty.getRenderEngine().createImage(screen,fileName, false); << needs screen
final ImageRenderer imageRenderer = background.getRenderer(ImageRenderer.class);
imageRenderer.setImage(image);
}
}
public void execute(final Element element,final float normalizedTime,final Falloff falloff,final NiftyRenderEngine r)
{
}
public void deactivate()
{
}
}
thanks