aboutsummaryrefslogtreecommitdiff
path: root/engine/src/test/jme3test/animation/SubtitleTrack.java
blob: afa6e7406c42ad71c62205aec3bffde967765603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jme3test.animation;

import com.jme3.cinematic.events.GuiTrack;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.elements.render.TextRenderer;

/**
 *
 * @author Nehon
 */
public class SubtitleTrack extends GuiTrack{
    private String text="";

    public SubtitleTrack(Nifty nifty, String screen,float initialDuration, String text) {
        super(nifty, screen, initialDuration);
        this.text=text;
    }

    @Override
    public void onPlay() {
        super.onPlay();
        nifty.getScreen(screen).findElementByName("text").getRenderer(TextRenderer.class).setText(text);
    }








}