Changeset 9b1e12c in network-game


Ignore:
Timestamp:
Jun 23, 2013, 5:12:01 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
b650f8a
Parents:
7ca5d21
Message:

Increased the size of the client window to 1024x768 and moved around some gui elements to fit the new size

Location:
client/Client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • client/Client/chat.cpp

    r7ca5d21 r9b1e12c  
    1919{
    2020   for(unsigned int x=0; x<vctChat.size(); x++)
    21       al_draw_text(font, color, 10, 140+x*15, ALLEGRO_ALIGN_LEFT, vctChat[x].c_str());
     21      al_draw_text(font, color, 5, 100+x*15, ALLEGRO_ALIGN_LEFT, vctChat[x].c_str());
    2222
    23    al_draw_text(font, color, 10, 460, ALLEGRO_ALIGN_LEFT, strPrompt.c_str());
     23   // I think this might never be used
     24   al_draw_text(font, color, 5, 460, ALLEGRO_ALIGN_LEFT, strPrompt.c_str());
    2425}
    2526
  • client/Client/main.cpp

    r7ca5d21 r9b1e12c  
    6565
    6666const float FPS = 60;
    67 const int SCREEN_W = 640;
    68 const int SCREEN_H = 480;
     67const int SCREEN_W = 1024;
     68const int SCREEN_H = 768;
    6969
    7070enum STATE {
     
    160160   }
    161161 
    162    display = al_create_display(SCREEN_W, SCREEN_H);
     162  display = al_create_display(SCREEN_W, SCREEN_H);
    163163   if(!display) {
    164164      fprintf(stderr, "failed to create display!\n");
     
    170170
    171171   wndLogin = new Window(0, 0, SCREEN_W, SCREEN_H);
    172    wndLogin->addComponent(new Textbox(104, 40, 100, 20, font));
    173    wndLogin->addComponent(new Textbox(104, 70, 100, 20, font));
    174    wndLogin->addComponent(new Button(22, 100, 90, 20, font, "Create an Account", goToRegisterScreen));
    175    wndLogin->addComponent(new Button(122, 100, 60, 20, font, "Login", login));
    176    wndLogin->addComponent(new Button(540, 10, 80, 20, font, "Quit", quit));
     172   wndLogin->addComponent(new Textbox(516, 40, 100, 20, font));
     173   wndLogin->addComponent(new Textbox(516, 70, 100, 20, font));
     174   wndLogin->addComponent(new Button(330, 100, 194, 20, font, "Create an Account", goToRegisterScreen));
     175   wndLogin->addComponent(new Button(534, 100, 60, 20, font, "Login", login));
     176   wndLogin->addComponent(new Button(920, 10, 80, 20, font, "Quit", quit));
    177177
    178178   txtUsername = (Textbox*)wndLogin->getComponent(0);
     
    180180
    181181   wndRegister = new Window(0, 0, SCREEN_W, SCREEN_H);
    182    wndRegister->addComponent(new Textbox(104, 40, 100, 20, font));
    183    wndRegister->addComponent(new Textbox(104, 70, 100, 20, font));
    184    wndRegister->addComponent(new Button(22, 100, 90, 20, font, "Back", goToLoginScreen));
    185    wndRegister->addComponent(new Button(122, 100, 60, 20, font, "Submit", registerAccount));
    186    wndRegister->addComponent(new Button(540, 10, 80, 20, font, "Quit", quit));
    187    wndRegister->addComponent(new RadioButtonList(20, 130, "Pick a class", font));
     182   wndRegister->addComponent(new Textbox(516, 40, 100, 20, font));
     183   wndRegister->addComponent(new Textbox(516, 70, 100, 20, font));
     184   wndRegister->addComponent(new Button(468, 100, 56, 20, font, "Back", goToLoginScreen));
     185   wndRegister->addComponent(new Button(534, 100, 70, 20, font, "Submit", registerAccount));
     186   wndRegister->addComponent(new Button(920, 10, 80, 20, font, "Quit", quit));
     187   wndRegister->addComponent(new RadioButtonList(432, 130, "Pick a class", font));
    188188
    189189   txtUsernameRegister = (Textbox*)wndRegister->getComponent(0);
     
    195195
    196196   wndMain = new Window(0, 0, SCREEN_W, SCREEN_H);
    197    wndMain->addComponent(new Textbox(95, 40, 525, 20, font));
    198    wndMain->addComponent(new Button(95, 70, 160, 20, font, "Send Message", sendChatMessage));
    199    wndMain->addComponent(new Button(540, 10, 80, 20, font, "Logout", logout));
     197   wndMain->addComponent(new Textbox(95, 40, 300, 20, font));
     198   wndMain->addComponent(new Button(95, 70, 60, 20, font, "Send", sendChatMessage));
     199   wndMain->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
    200200
    201201   txtChat = (Textbox*)wndMain->getComponent(0);
     
    365365         // There should be label gui components that show these or each textbox should have a label
    366366         if(wndCurrent == wndLogin || wndCurrent == wndRegister) {
    367             al_draw_text(font, al_map_rgb(0, 255, 0), 4, 43, ALLEGRO_ALIGN_LEFT, "Username:");
    368             al_draw_text(font, al_map_rgb(0, 255, 0), 1, 73, ALLEGRO_ALIGN_LEFT, "Password:");
     367            al_draw_text(font, al_map_rgb(0, 255, 0), 416, 43, ALLEGRO_ALIGN_LEFT, "Username:");
     368            al_draw_text(font, al_map_rgb(0, 255, 0), 413, 73, ALLEGRO_ALIGN_LEFT, "Password:");
    369369         }
    370370         else if(wndCurrent == wndMain) {
Note: See TracChangeset for help on using the changeset viewer.