Stuck!

Hi All,



I'm relatively new to the jMonkeyengine and I was wondering if someone would be able to help with my problems

I've been trying to develop a timer in my game to time how long the player takes to perform a task. I've written the following code:



1.private void timeGame(){

2.  Text time;

3.  Node timerNode = new Node();

4.  for(int start=0;start<99;start++){

5.      time = new Text("Time", "Time Elapsed: " + start);

6.      time.setLocalTranslation(new Vector3f(600,10,0));

7.      timerNode.attachChild(time);

8.      fpsNode.attachChild(timerNode);

9.      try {

10.        Thread.sleep(1000);

11.      } catch (InterruptedException e) {

12.        e.printStackTrace();

13.      }

14.      time = new Text("Time", "Time Elapsed:      ");

15.  }

16.}



Basically when this code is running in my program it seems that every value from 0 to 99 prints to the screen leaving a blur,

as they are all superimposed on one another. Is there a way to clear the screen each frame so that with each second the

new text for time is rendered. I thought Line 14 w ould solve this but it has made no effect. I've heard that it is difficult to

put things on the fpsNode successfully. Can someone help or suggest an alternative?

Thanks in Advance

Please don’t cross post:



http://www.jmonkeyengine.com/jmeforum/index.php?topic=4573