Game Development Reference
In-Depth Information
Listing 9-34. Updating the High Score Entry Menu
void UpdateHighScoreEntryMenu(Camera Cam)
{
//Update Menu Texture if changed
if (m_Dirty)
{
// If need to alter Menu texture then render new texture data
RenderEntryToMenu();
m_Dirty = false;
}
// Update Buttons
m_NextCharacterButton.UpdateObject3d(Cam);
m_PreviousCharacterButton.UpdateObject3d(Cam);
m_EnterButton.UpdateObject3d(Cam);
// Update Initial Entry Area
m_HighScoreEntryMenuImage.UpdateObject3d(Cam);
}
The RenderHighScoreEntryMenu() function (see Listing 9-35) renders all the components of the high
score entry menu to the screen in the following order:
1.
Renders the cycle to the Next Character button
2.
Renders the cycle to the Previous Character button
3.
Renders the Enter player initial selection button
Renders the m_HighScoreEntryMenuImage billboard, which contains the
player's input and the rest of the high score entry menu graphics data
4.
Listing 9-35. Rendering the High Score Entry Menu
void RenderHighScoreEntryMenu(Camera Cam, PointLight Light, boolean DebugOn)
{
// Render Buttons
m_NextCharacterButton.DrawObject(Cam, Light);
m_PreviousCharacterButton.DrawObject(Cam, Light);
m_EnterButton.DrawObject(Cam, Light);
// Render Billboard with Entry Menu info
m_HighScoreEntryMenuImage.DrawObject(Cam, Light);
}
Hands-on Example: Demonstrating the User Interface
In this hands-on example, we will hook the user interface to the hands-on example from Chapter 8.
We will construct a working main menu from which the user can select a new game or continue a
previously saved game. For the high score table, we will use a test button to input some high scores
manually, before making this feature fully functional in the final game in Chapter 10.
 
Search WWH ::




Custom Search