Nifty gui custom effect

hello i have created a custom effect, is there a way to access it from my code :

E.g myElement.getCustomEffect() ?

I have searched all methods and didnt find any method for this.

I need this in order to notify the effect that the “parameters” have changed. E.g when my custom control changes the way things are displayed.

Here is an example: Get all move effects of an element (there could be multiple) check if we actually get at least one and then access the first Move effect and change some effect properties. The same should work for custom effects.



[java]Element element = …; // get your element

List<Effect> moveEffects = element.getEffects(EffectEventId.onStartScreen, Move.class);

if (!moveEffects.isEmpty()) {

moveEffects.get(0).getParameters().setProperty("offsetY", String.valueOf(direction * listBox.getHeight()));

moveEffects.get(0).getParameters().setProperty("mode", "fromOffset");

}[/java]

1 Like

nice thank you