2011-03-14 12:55:32 +00:00
|
|
|
/*
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package jme3test.animation;
|
|
|
|
|
|
|
|
import com.jme3.cinematic.events.GuiTrack;
|
2011-12-03 01:22:42 +00:00
|
|
|
import de.lessvoid.nifty.Nifty;
|
2011-03-14 12:55:32 +00:00
|
|
|
import de.lessvoid.nifty.elements.render.TextRenderer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author Nehon
|
|
|
|
*/
|
|
|
|
public class SubtitleTrack extends GuiTrack{
|
|
|
|
private String text="";
|
|
|
|
|
2011-12-03 01:22:42 +00:00
|
|
|
public SubtitleTrack(Nifty nifty, String screen,float initialDuration, String text) {
|
|
|
|
super(nifty, screen, initialDuration);
|
2011-03-14 12:55:32 +00:00
|
|
|
this.text=text;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onPlay() {
|
|
|
|
super.onPlay();
|
2011-10-18 19:01:09 +00:00
|
|
|
nifty.getScreen(screen).findElementByName("text").getRenderer(TextRenderer.class).setText(text);
|
2011-03-14 12:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|