Canvas Methods
The Code Sourcerer can generate code which is useful for working with a Canvas object. The options include
- Get the height of the displayable area This option gets the current height of the canvas. This should be used so applications can display more or less information depending upon the available display area.
- Get the width of the displayable area This option gets the current width of the canvas. This should be used so applications can display more or less information depending upon the available display area.
- Are pointer events enabled? Not all devices in the MID Profile have pointers, or have pointer events enabled.
- Are pointer motion events enabled?
- Are key repeat events enabled?
- Is double buffering enabled? Double buffering is not guaranteed to be enabled on a MID Profile device. If it is not enabled, programmers may wish to implement a form of double buffering themselves.
- Get key name for the game action The MID Profile describes several actions which may be used in games (Up, Down, Fire, etc.); these actions may be mapped to different keys on different MID-enabled devices. This Sourcerer option is useful for determining what the name of the key associated with an action is on the particular device.
- Get game action which corresponds to key code The Code Sourcerer will write code which helps to determine which game action (Up, Down, Fire, etc.) should correspond to a given key code. Since different keys may be used on different MID-enabled devices, this will ensure that MIDlets will be device-independent.
| Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |