1/* 2 * To change this template, choose Tools | Templates 3 * and open the template in the editor. 4 */ 5 6package jme3test.animation; 7 8import com.jme3.cinematic.events.GuiTrack; 9import de.lessvoid.nifty.Nifty; 10import de.lessvoid.nifty.elements.render.TextRenderer; 11 12/** 13 * 14 * @author Nehon 15 */ 16public class SubtitleTrack extends GuiTrack{ 17 private String text=""; 18 19 public SubtitleTrack(Nifty nifty, String screen,float initialDuration, String text) { 20 super(nifty, screen, initialDuration); 21 this.text=text; 22 } 23 24 @Override 25 public void onPlay() { 26 super.onPlay(); 27 nifty.getScreen(screen).findElementByName("text").getRenderer(TextRenderer.class).setText(text); 28 } 29 30 31 32 33 34 35 36 37} 38