Game Development Reference
In-Depth Information
Texture[] Tex = new Texture[NumberTextures];
Tex[0] = TexNewGameButton;
boolean AnimateTextures = false;
float TimeDelay = 0.0f;
Vector3 Position = new Vector3(0.0f, 2.5f, 4.25f);
Vector3 Scale = new Vector3(3.0f,1.0f,1.0f);
MenuItem NewGameMenuItem = CreateMenuItem(iContext, MenuItemMesh,MenuItemMeshEx,
Material1, NumberTextures, Tex, AnimateTextures, TimeDelay, Position, Scale, ObjectShader);
// Continue Game
Position = new Vector3(0.0f, 1.3f, 4.25f);
Texture TexContinueGameButton = new Texture(iContext, R.drawable.continuegamebutton);
Tex = new Texture[NumberTextures];
Tex[0] = TexContinueGameButton;
MenuItem ContinueGameMenuItem = CreateMenuItem(iContext, MenuItemMesh, MenuItemMeshEx,
Material1, NumberTextures, Tex, AnimateTextures, TimeDelay, Position, Scale, ObjectShader);
// View High Scores
Position = new Vector3(0.0f, 0.0f, 4.25f);
Texture TexHighScoresButton = new Texture(iContext, R.drawable.highscoresbutton);
Tex = new Texture[NumberTextures];
Tex[0] = TexHighScoresButton;
MenuItem HighScoreMenuItem = CreateMenuItem(iContext, MenuItemMesh, MenuItemMeshEx,
Material1, NumberTextures, Tex, AnimateTextures, TimeDelay, Position, Scale, ObjectShader);
// CopyRight Notice
Position = new Vector3(0.0f, -1.3f, 4.25f);
Texture TexCopyrightButton = new Texture(iContext,R.drawable.copyright);
Tex = new Texture[NumberTextures];
Tex[0] = TexCopyrightButton;
Material Material2 = new Material();
Material2.SetEmissive(0.3f, 0.3f, 0.3f);
MenuItem CopyrightMenuItem = CreateMenuItem(iContext, MenuItemMesh, MenuItemMeshEx,
Material2, NumberTextures, Tex, AnimateTextures, TimeDelay, Position, Scale, ObjectShader);
m_MainMenu = new MainMenu(NewGameMenuItem, ContinueGameMenuItem,
HighScoreMenuItem, CopyrightMenuItem);
}
The CheckTouch() function has to be modified (see Listing 9-42). The CheckTouch() function is called
when the user touches the screen and is used to process user touches.
 
Search WWH ::




Custom Search