Moved buttons and info around

This commit is contained in:
Anna Rose 2011-07-04 02:23:20 -04:00
parent 7d1ceb396b
commit c2ecbf5c23

View File

@ -53,27 +53,26 @@ bool Game::init()
DrawUtils::transpare(producer_icon); DrawUtils::transpare(producer_icon);
int row1 = display->h - 95; int row1 = display->h - 95;
int row2 = display->h - 50; int row2 = display->h - 65;
int row3 = display->h - 35;
int col1 = 155; int col1 = 155;
int col2 = 260; int col2 = 255;
int col3 = 365; int col3 = 355;
int col4 = 470; int col4 = 455;
int col5 = 575;
int col6 = 680;
buttons.push_back(new MenuButton("Move (m)", font, col1, row1, buttons.push_back(new MenuButton("Move (m)", font, col1, row1,
BUTTON_MOVE)); BUTTON_MOVE));
buttons.push_back(new MenuButton("Build (b)", font, col1, row2, buttons.push_back(new MenuButton("Build (b)", font, col1, row2,
BUTTON_BUILD)); BUTTON_BUILD));
buttons.push_back(new MenuButton("Attack (a)", font, col2, row1, buttons.push_back(new MenuButton("Attack (a)", font, col1, row3,
BUTTON_ATTACK)); BUTTON_ATTACK));
buttons.push_back(new MenuButton("Attacker (t)", font, col3, row1, buttons.push_back(new MenuButton("Attacker (t)", font, col2, row1,
BUTTON_BUILD_ATTACKER)); BUTTON_BUILD_ATTACKER));
buttons.push_back(new MenuButton("Defender (d)", font, col3, row2, buttons.push_back(new MenuButton("Defender (d)", font, col2, row2,
BUTTON_BUILD_DEFENDER)); BUTTON_BUILD_DEFENDER));
buttons.push_back(new MenuButton("Producer (p)", font, col4, row1, buttons.push_back(new MenuButton("Producer (p)", font, col2, row3,
BUTTON_BUILD_PRODUCER)); BUTTON_BUILD_PRODUCER));
buttons.push_back(new MenuButton("End Turn (e)", font, col6, row2, buttons.push_back(new MenuButton("End Turn (e)", font, col4, row3,
BUTTON_END_TURN)); BUTTON_END_TURN));
@ -148,11 +147,15 @@ void Game::render()
DrawUtils::draw_line(display, 0, display->h - 100, DrawUtils::draw_line(display, 0, display->h - 100,
display->w, display->h - 100, 2, 0x000000); display->w, display->h - 100, 2, 0x000000);
// vertical line to separate info pane from button pane // vertical lines to separate info panes from button pane
DrawUtils::draw_line(display, 150, display->h - 100, 150, display->h, 2, DrawUtils::draw_line(display, 150, display->h - 100, 150, display->h, 2,
0x000000); 0x000000);
DrawUtils::draw_line(display, 540, display->h - 100, 540, display->h, 2,
0x000000);
DrawUtils::draw_line(display, display->w - 100, display->h - 100,
display->w - 100, display->h, 2,
0x000000);
{
for (list<MenuButton*>::iterator cursor = buttons.begin(); for (list<MenuButton*>::iterator cursor = buttons.begin();
cursor != buttons.end(); cursor++) cursor != buttons.end(); cursor++)
{ {
@ -171,7 +174,6 @@ void Game::render()
draw_button(button); draw_button(button);
} }
}
draw_player_info(); draw_player_info();
@ -228,12 +230,12 @@ void Game::draw_player_info()
{ {
Player* player = data.get_turn(); Player* player = data.get_turn();
DrawUtils::draw_text(display, player->get_name(), 680, display->h - 95, DrawUtils::draw_text(display, player->get_name(), 10, display->h - 95,
font); font);
string temp = "Energy: "; string temp = "Energy: ";
temp += itos(player->get_energy()); temp += itos(player->get_energy());
DrawUtils::draw_text(display, temp, 680, display->h - 80, font); DrawUtils::draw_text(display, temp, 10, display->h - 80, font);
} }
@ -270,11 +272,11 @@ void Game::draw_stats(GameVertex* v)
{ {
int line_num = 0; int line_num = 0;
int line_height = 14; int line_height = 14;
int x = 10; int x = 550;
int y = display->h - 95; int y = display->h - 95;
int adj_y = y; int adj_y = y;
DrawUtils::draw_text(display, "player:", x, adj_y, font); DrawUtils::draw_text(display, "owner:", x, adj_y, font);
DrawUtils::draw_text(display, v->player->get_name(), x + 50, adj_y, font); DrawUtils::draw_text(display, v->player->get_name(), x + 50, adj_y, font);
line_num++; line_num++;