I wanted the user to be able to press space to skip the fade in etc. and just show the screen (or just skip the page all together)
So what I tried to do was this:
for (Element layerElement : screen.getLayerElements()) {
layerElement.stopEffect(EffectEventId.onStartScreen);
}
But what happens then is that the screen never gets to know the effects are done. So when you try to goto a new page you get this error:
INFO: gotoScreen [mainMenu] aborted because still in gotoScreenInProgress phase
What I ended up doing was this:
Class<? extends Nifty> aClass = nifty.getClass();
Field field = aClass.getDeclaredField("gotoScreenInProgess");
field.setAccessible(true);
field.set(nifty, false);
Not very pretty. The other alternative I thought of was to fiddle with the “startTime” of the TimeInterpolator instances in the effects. That could be more powerful because then I could do something like “speed up” the effects when the user presses a key but also more of the same reflection magic. Not very clean. Is there a better way to do that?