/**
* Displays the applications splash screen. Explains the game's controls and
* objective. Allows the user to choose between using OpenGL v1.1 or v2.0.
*/
private void displaySplashScreen() {
final VerticalFieldManager vfm =
new VerticalFieldManager(Manager.VERTICAL_SCROLL);
// Initialize and add the logo to the splash screen
final Bitmap bm = Bitmap.getBitmapResource("RandOmazeLogo.png");
_bitmapField = new BitmapField(bm, Field.FIELD_HCENTER);
_bitmapField.setMargin(0, 0, 0, 0);
vfm.add(_bitmapField);
// Initialize and add the instructions to the splash screen
final String instructions =
"The goal of the game is to move the character to the "
+ "special end block without being hit by any of the obstacles.\n";
_labelField = new LabelField(instructions);
_labelField.setBorder(BorderFactory.createRoundedBorder(new XYEdges(10,
10, 10, 10), Color.RED, Border.STYLE_SOLID));
_labelField.setMargin(0, 10, 5, 10);
vfm.add(_labelField);
// Check if the device supports OpenGL v2.0
if (GLUtils.isSupported(GLField.VERSION_2_0)) {
// Set up the version array for the different GL
// versions that the device supports.
final String[] versions = new String[2];
versions[0] = "OpenGL ES 1.1";
versions[1] = "OpenGL ES 2.0";
// Initialize and add the ObjectChoiceField that lets the users
// choose what version of OpenGL they want to use.
_glVersionField =
new ObjectChoiceField("", new String[] { "OpenGL ES 1.1",
"OpenGL ES 2.0" }, 1, Field.FIELD_HCENTER);
vfm.add(_glVersionField);
}
// Initialize "Controls" button
_controlsButton = new ButtonField("Controls", Field.FIELD_HCENTER);
_controlsButton.setChangeListener(this);
// Initialize "Start" button
_startButton = new ButtonField("Start", Field.FIELD_HCENTER);
_startButton.setChangeListener(this);
// Add buttons
final HorizontalFieldManager hfm =
new HorizontalFieldManager(Field.FIELD_HCENTER);
hfm.add(_controlsButton);
hfm.add(_startButton);
vfm.add(hfm);
add(vfm);
// Disable screen rotation and context menu
Ui.getUiEngineInstance().setAcceptableDirections(