■x: The
■y: The
■width: The width of the button image, in pixels
■height: The height of the button image, in pixels.
For example,
button.LEFT = 13, 197, 20, 20
For the second form (polygonal), the definitions for button_name, x, and y are the same as for the rectangular form. The polygonal form can consist of multiple points defined by x and y coordinates. A minimum of three sets of x and y coordinates are required to use this form.
For example, if the LEFT button were polygonal, it could have the following values:
button.LEFT = 166, 420, 143, 432, 143, 406
The button location and dimensions are used for two purposes:
■To define the active region in which a mouse click is interpreted as a button press.
■To define the region of the device image that is used to show graphic effects on device buttons.
The region for each button should be defined to be large enough to cover the button's area on all three device images. However, be careful not to allow the buttons' regions to overlap each other.
The button coordinates are shown in FIGURE 6.