| [ directory ] |
|
Chapter 10. Canvas ScreensA canvas provides access to low-level input mechanisms, such as key presses and low-level graphics calls, such as drawing simple shapes. A canvas can be useful to an application that needs full control of the screen. It can be used as a way to edit or display a custom item off the form, for example. SmartTicket uses a canvas, shown in Figure 10.1, for the screen that enables a user to choose a seat in the theater. The canvas displays a graphic of a floor plan. Figure 10.1. SmartTicket's Canvas Screen
MIDP 2.0 also provides an extension to Canvas screens, called a game canvas. The game canvas has additional features such as sprites, background panning, layers, and an offscreen buffer. The advice in this chapter also applies to the games canvas (except for the discussion on creating your own offscreen buffer); additional advice, specific to the game canvas, is covered in Chapter 11.
Because a canvas provides access to lower-level functionality, an application developer can create a screen that is tuned for a particular device. It is also possible, by following the guidelines in this chapter, to create portable applications that use a canvas screen. The advice will also help in creating canvas screens that integrate well with high-level screens in an application. |
| [ directory ] |
|