September 2016
Beginner to intermediate
1089 pages
23h 8m
English
We have updated the
DrawThread to run at an arbitrary number of frames per second, adapting to the time required to render instead of a fixed 30 fps, and we are using sprites. Now is the perfect time to add a frames-per-second counter. It is a very easy tool and is also handy to check performance.
We could have used a TextView, but there are some good reasons to draw it on the Canvas directly instead:
SurfaceView suffers when we overlay other views on top of itCanvasWe will make a class named FPSCounter that extends from GameObject and looks like this:
public class FPSCounter ...
Read now
Unlock full access