Game Development Reference
In-Depth Information
The
m_CurrentEntryPositionX
variable holds the current x position of the player's name/initials
entry location.
private int m_CurrentEntryPositionX;
The
m_CurrentEntryPositionY
variable holds the current y position of the player's name/initials
entry location.
private int m_CurrentEntryPositionY;
The
m_EntryFinished
variable is true if the user has finished entering his or her name/initials.
private boolean m_EntryFinished = false;
The HighScoreEntryMenu constructor initializes and resets the high score entry menu for use.
(See Listing 9-25.)
Listing 9-25. The HighScoreEntryMenu Constructor
HighScoreEntryMenu(MenuItem NextCharacterButton,MenuItem PreviousCharacterButton,MenuItem Ente
rButton,BillBoardCharacterSet Text,BillBoard HighScoreEntryMenuImage,int StartingEntryXPos,int
StartingEntryYPos)
{
m_NextCharacterButton = NextCharacterButton;
m_PreviousCharacterButton = PreviousCharacterButton;
m_EnterButton = EnterButton;
m_Text = Text;
m_HighScoreEntryMenuImage = HighScoreEntryMenuImage;
m_FontWidth = m_Text.GetFontWidth();
m_FontHeight = m_Text.GetFontHeight();
m_NumberCharactersInSet = m_Text.GetNumberCharactersInSet();
m_CurrentEntryPositionX = StartingEntryXPos;
m_CurrentEntryPositionY = StartingEntryYPos;
m_StartingEntryPositionX = StartingEntryXPos;
m_StartingEntryPositionY = StartingEntryYPos;
ResetMenu();
}
The
ResetMenu()
function resets the menu to its initial state, where the user can begin entering his or
her initials, starting at the first initial. The default initial is reset to
"..."
. (See Listing 9-26.)