We've covered a lot of ground in this chapter. The Canvas class provides a low-level interface for games or other demanding applications. You can draw shapes, text, and images on a Canvas using the Graphics class. Furthermore, you can receive detailed input information about which keys the user is pressing. Game actions are a simple generalized input method based on key events. Finally, you should understand the multithreading issues with repainting and event callbacks. Lengthy processing should be placed a separate thread so it doesn't bring the system-owned user-interface thread to a grinding halt. Animations can use Display's callSerially() method to synchronize with the user-interface thread.
Team-Fly |