Timing
To do animation or anything that requires delay, in the builder, just drag over animation. It adds two things to your code (so you could do it manually). In initialize, it adds :
It also adds another method - update which gets called automatically every 50 milliseconds.Update gets the temporary layer and when you are done, it will automatically call drawScreen putting up that temporary layer.
Assignment:
In a class called HWJ10_Text, have some fun text (use g.drawString("text",x,y); Starter
Advanced:
You can update the amount of delay (frame rate) by saying:
You can stop animation by saying:
You can start animation by saying:
|