/** * passing true has the same effect as play() you should use play(), * pause(), stop() to handle the cinematic playing state. * * @param enabled true or false */ public void setEnabled(boolean enabled) { if (enabled) { play(); } }
public void onAction(String name, boolean isPressed, float tpf) { if(name.equals("start") && isPressed){ if(cinematic.getPlayState() != PlayState.Playing){ cinematic.play(); }else{ cinematic.pause(); } } } }, "start");
public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("togglePause") && keyPressed) { if (cinematic.getPlayState() == PlayState.Playing) { cinematic.pause(); time = cinematic.getTime(); } else { cinematic.play(); } } if (cinematic.getPlayState() != PlayState.Playing) { if (name.equals("navFwd") && keyPressed) { time += 0.25; FastMath.clamp(time, 0, cinematic.getInitialDuration()); cinematic.setTime(time); } if (name.equals("navBack") && keyPressed) { time -= 0.25; FastMath.clamp(time, 0, cinematic.getInitialDuration()); cinematic.setTime(time); } } } };
cinematic.setSpeed(1.2f); cinematic.setLoopMode(LoopMode.Loop); cinematic.play();
/** * passing true has the same effect as play() you should use play(), * pause(), stop() to handle the cinematic playing state. * * @param enabled true or false */ public void setEnabled(boolean enabled) { if (enabled) { play(); } }