Package doodlepad
Class Throttle
java.lang.Object
doodlepad.Throttle
A class that attempts to smooth out looping animation by measuring and
executing the appropriate delay between frames.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Throttle
public Throttle()Default constructor. Set frame rate to 60 frames per second. -
Throttle
public Throttle(long fps) Constructor that allows frame rate to be set.- Parameters:
fps
- Frames per second
-
-
Method Details
-
start
public void start()Reset the start time, which is used to measure frame duration. -
delay
public void delay()Compute the amount of time remaining in the current frame duration and sleep until the next frame begins.
-