Need help with displaying text for a certain amount of time [UnSolved]

Hello Everyone,

I need your help on something and i would really appreciate it. I just cant get my head around doing it. Basically what I want is,when I change level in my game I want to text on the screen saying “Next Level” for about 2 seconds, then disappear. This might seem really basic but i just want to know whats the best way to do this.

Does anyone know how ?

Thanks for you help,

  • GlennBrann

What library are you using?

just the regular java library. no 3rd party libraries.

Something along the lines of…


int displayTime = 50; //Change accordingly
public void update() //Or whatever your update/draw method is called
{
    if(displayTime > 0)
    {
        //Code to display text here
        displayTime -= 1;
    }
}

That’s a really simple way to do it.