Motorola E680 Technical Manual - Page 26

Gaming API/Multiple Key Press

Page 26 highlights

8 Gaming API/Multiple Key Press Gaming API The Gaming API provides a series of classes that enable rich gaming content for the handset. This API improves performance by minimizing the amount of work done in Java, decreasing application size. The Gaming API is structured to provide freedom in implementation, extensively using native code, hardware acceleration, and device-specific image data formats as needed. The API uses standard low-level graphic classes from MIDP so the high-level Gaming API classes can be used in conjunction with graphics primitives. This allows for rendering a complex background using the Gaming API while rendering something on top of it using graphics primitives. Methods that modify the state of Layer, LayerManager, Sprite, and TiledLayer objects generally do not have any immediate visible side effects. Instead, this state is stored within the object and is used during subsequent calls to the paint() method. This approach is suitable for gaming applications where there is a cycle within the objects' states being updated and the entire screen is redrawn at the end of every game cycle. Multiple Key Press Support Multi-button press support enhances the gaming experience for the user. Multi-button press support gives the user the ability to press two (2) keys simultaneously and the corresponding actions of both keys will occur simultaneously. An example of this action would be the following: • If Left + Fire were pressed at the same time, the Java object (e.g Canvas) will receive Left Pressed + Fire Pressed. In the same way, when the 2 keys are released, Java object (e.g. Canvas) will receive Left Released + Fire Released. The following sets of keys will support multi-button press support on the Motorola E680 handset. Multi-button press within each set will be supported, while multi-button press across these sets or with other keys will not be supported. Set 1 - Nav (Up), Nav (Down), Nav (Right, Nav (Left) 26

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107

26
8
Gaming API/Multiple Key Press
Gaming API
The Gaming API provides a series of classes that enable rich gaming content for the
handset. This API improves performance by minimizing the amount of work done in Java,
decreasing application size. The Gaming API is structured to provide freedom in
implementation, extensively using native code, hardware acceleration, and device-specific
image data formats as needed.
The API uses standard low-level graphic classes from MIDP so the high-level Gaming API
classes can be used in conjunction with graphics primitives. This allows for rendering a
complex background using the Gaming API while rendering something on top of it using
graphics primitives.
Methods that modify the state of Layer, LayerManager, Sprite, and TiledLayer objects
generally do not have any immediate visible side effects. Instead, this state is stored
within the object and is used during subsequent calls to the
paint()
method. This
approach is suitable for gaming applications where there is a cycle within the objects’
states being updated and the entire screen is redrawn at the end of every game cycle.
Multiple Key Press Support
Multi-button press support enhances the gaming experience for the user. Multi-button
press support gives the user the ability to press two (2) keys simultaneously and the
corresponding actions of both keys will occur simultaneously. An example of this action
would be the following:
If Left + Fire were pressed at the same time, the Java object (e.g Canvas) will
receive Left Pressed + Fire Pressed. In the same way, when the 2 keys are
released, Java object (e.g. Canvas) will receive Left Released + Fire Released.
The following sets of keys will support multi-button press support on the Motorola E680
handset. Multi-button press within each set will be supported, while multi-button press
across these sets or with other keys will not be supported.
Set 1 – Nav (Up), Nav (Down), Nav (Right, Nav (Left)