This commit is contained in:
2010-08-30 14:51:32 +02:00
13 changed files with 224 additions and 6 deletions
+23 -3
View File
@@ -16,6 +16,8 @@
#include "Engine.h"
#include "Game.h"
#include "IMGUIControls.h"
namespace asteroids {
// static float left = 0;
@@ -68,15 +70,31 @@ void MainMenuOverlay::Draw () {
glPushMatrix ();
glLoadIdentity ();
// Engine::DrawGLString ( right * 0.5 - 100, 100, "A s t e r o i d s");
Engine::GUI::Label (4, "A s t e r o i d s", right * 0.5 - 100, 180);
if (Engine::GUI::Button (1, "Start Game", right * 0.5 - 100, 200, 250, 40)) {
GetModel()->SetGameState(GameStateEnterPlayername);
}
if (Engine::GUI::Button (2, "Highscores", right * 0.5 - 100, 250, 250, 40)) {
GetModel()->SetGameState(GameStateShowHighscore);
}
if (Engine::GUI::Button (3, "Quit", right * 0.5 - 100, 330, 250, 40)) {
Engine::RunCommand("quit");
}
GetView()->SelectFont("console.ttf");
/*
// then we do the drawings
Engine::DrawGLString ( right * 0.5 - 100, bottom * 0.5 - 8 - 64, "A s t e r o i d s");
Engine::DrawGLString ( right * 0.5 - 100, bottom * 0.5 - 8 - 32, "Main Menu");
Engine::DrawGLString ( right * 0.5 - 80, bottom * 0.5 - 8 - 16, "[Return] - Start Game");
Engine::DrawGLString ( right * 0.5 - 80, bottom * 0.5 - 8, "[h] - Show Highscore");
Engine::DrawGLString ( right * 0.5 - 80, bottom * 0.5 + 8, "[Escape] - Quit");
*/
glPopMatrix ();
glMatrixMode (GL_PROJECTION);
@@ -602,7 +620,9 @@ void EnterPlayernameOverlay::Draw () {
Engine::DrawGLString ( x, y, "Enter your name: ");
std::string name_output (mPlayerNameInput);
name_output += "_";
if (SDL_GetTicks() >> 9 & 1)
name_output += "_";
Engine::DrawGLString ( x + 15*8, y, name_output.c_str());
Engine::DrawGLString ( x + 16, y + 16, "Press [Return] to continue.");
+1
View File
@@ -7,6 +7,7 @@ class OverlayBase;
#include "OverlayBase.h"
#include "Sprite.h"
#include "IMGUIControls.h"
#include <string>
namespace asteroids {