Game Development Reference
In-Depth Information
The ProcessPreviousMenuSelection() function processes the Previous character menu button by
decrementing the index used to retrieve the current character selection from the character set held in
m_Text . If the index is less than 0, it wraps around to point to the last character in the character set.
The m_Dirty variable is also set to true. (See Listing 9-29.)
Listing 9-29. Processing the Previous Character Menu Selection Button
void ProcessPreviousMenuSelection()
{
// Go to next character
m_CharacterSetIndex--;
if (m_CharacterSetIndex < 0)
{
m_CharacterSetIndex = m_NumberCharactersInSet-1;
}
m_Dirty = true;
}
The ProcessNextMenuSelection() function processes the Next character menu button by
incrementing the index used to retrieve the current character selection from the character set held in
m_Text . If the index is greater than the last element in the array, it wraps around to point to the first
character in the character set. The m_Dirty variable is also set to true. (See Listing 9-30.)
Listing 9-30. Processing the Next Menu Selection Button
void ProcessNextMenuSelection()
{
// Go to next character
m_CharacterSetIndex++;
if (m_CharacterSetIndex >= m_NumberCharactersInSet)
{
m_CharacterSetIndex = 0;
}
m_Dirty = true;
}
The RenderTextToMenu() function renders the input character Character at screen position
( XPos, YPos ) on the high score entry menu, which is the billboard m_HighScoreEntryMenuImage .
(See Listing 9-31.)
Listing 9-31. Rendering Text to the Entry Menu
void RenderTextToMenu(String Character, int XPos, int YPos)
{
m_Text.SetText(Character.toCharArray());
m_Text.RenderToBillBoard(m_HighScoreEntryMenuImage, XPos , YPos);
}
 
Search WWH ::




Custom Search