Motorola C550, C450, C370 technical manual Information, disabling key events can improve performance

Models: C450 C550 C370

1 86
Download 86 pages 61.66 Kb
Page 42
Image 42

information, disabling key events can improve performance.

Note that this setting is unique to each GameScreen instance; other GameScreens, when shown, are subject to their own setting for key events.

public void paint(javax.microedition.lcdui.Graphics g) - Paints this GameScreen. By default, this method does nothing. It can be overridden according to application needs.

public void flushGraphics(int x, int y, int width,

int height) – Waits until the end of the current screen refresh cycle and then flushes the specified region of the off-screen buffer to the display driver. This method does not return until that region of the buffer has been completely flushed. The pixels of the off-screen buffer are not changed as a result of the flush operation. Upon returning from this method, the application may immediately begin to render the next frame using the same buffer.

public void flushGraphics() - Waits until the end of the current screen refresh cycle and then flushes all of the off-screen buffer to the display driver. This method does not return until the entire buffer has been completely flushed. The pixels of the off-screen buffer are not changed as a result of the flush operation. Upon returning from this method, the app may immediately begin to render the next frame using the same buffer.

public static int getDisplayColor(int color) throws IllegalArgumentException – Gets the color that will be displayed if the specified color is requested. This method enables the developer to check the manner in which RGB values are mapped to the set of distinct colors that the device can actually display. For example, with a monochrome device, this method will return either 0xFFFFFF (white) or 0x000000 (black) depending on the brightness of the specified color.

public void playSoundEffect(SoundEffect se, int volume, int priority) - Plays the specified SoundEffect. A GameScreen's sound effects are heard only while it is the visible screen. A device capability of playing SoundEffects can be found by using the method soundEffectsSupported(). The platform's ability to play several SoundEffects simultaneously can be found by using the method getMaxSoundsSupported(). The priority specified for each request determines which sound(s) are heard when the number of simultaneous sound requests exceeds the capabilities of the device.

public boolean soundEffectsSupported() - Checks whether the underlying platform supports SoundEffects. It returns true if SoundEffects are supported.

public boolean backgroundMusicSupported() - Checks whether the underlying platform supports BackgroundMusic. It returns true if BackgroundMusic is supported.

public int getMaxSoundsSupported() - Queries the underlying platform's capability to play multiple SoundEffects simultaneously.

public void stopAllSoundEffects() - Stops all the SoundEffects that are playing. Note that this method does not affect background music.

Page 42
Image 42
Motorola C550, C450, C370 technical manual Information, disabling key events can improve performance