Game Development Reference
In-Depth Information
Figure 4-15. Fun with text (480×800-pixel resolution)
Another mystery of the Typeface class is that it does not explicitly allow us to release all its
resources. We have to rely on the garbage collector to do the dirty work for us.
Note We only scratched the surface of text rendering here. If you want to know more . . . well, by
now you know where to look.
Continuous Rendering with SurfaceView
This is the section where we become real men and women. It involves threading, and all the pain
that is associated with it. We'll get through it alive. We promise!
Motivation
When we first tried to do continuous rendering, we did it the wrong way. Hogging the UI thread
is unacceptable; we need a solution that does all the dirty work in a separate thread. Enter
SurfaceView .
As the name gives away, the SurfaceView class is a View that handles a Surface , another class
of the Android API. What is a Surface ? It's an abstraction of a raw buffer that is used by the
screen compositor for rendering that specific View . The screen compositor is the mastermind
 
 
Search WWH ::




Custom Search