Changeset 261


Ignore:
Timestamp:
03/24/12 14:41:58 (3 years ago)
Author:
rthomas
Message:

main menu structure

Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/leftRight.py

    r257 r261  
    1717        self.right = isRight
    1818        if self.right:
    19             icon = pygame.image.load(imageDir + os.sep + "map"+ os.sep + "right.png")
     19            icon = pygame.image.load(arrowsDir + "right.png")
    2020        else:
    21             icon = pygame.image.load(imageDir + os.sep + "map"+ os.sep + "left.png")
     21            icon = pygame.image.load(arrowsDir + "left.png")
    2222
    2323        self.images.append(Image(self.pos, 44, 44, icon))
  • src/main.py

    r259 r261  
    1919import map
    2020import spinner
     21import mainMenu
     22import mainMenuButton
    2123from buildables import buildingLUT
    2224
     
    3840    newBackground = background.Background((0,0),True,'background.png')
    3941   
     42    ############################################################################################
     43   
     44    #menuBackground = background.Background((0,0),True,'menuBackground.jpg')
     45   
     46   
     47    mainMenuWindow = mainMenu.MainMenu((400,100),True)
     48   
     49    newGameButton = mainMenuButton.MainMenuButton((450,170+MAIN_SHIFT*0),True,'New Game')
     50    newGameButton.addResponse((mainMenuWindow.toggle,))
     51    # will also need to set new state and show opening sequence
     52   
     53    resumeButton = mainMenuButton.MainMenuButton((450,170+MAIN_SHIFT*1),False,'Resume')
     54    resumeButton.addResponse((mainMenuWindow.toggle,))
     55   
     56    loadButton = mainMenuButton.MainMenuButton((450,170+MAIN_SHIFT*2),True,'Load')
     57    # will need a response
     58   
     59    saveButton = mainMenuButton.MainMenuButton((450,170+MAIN_SHIFT*3),False,'Save')
     60    # will need a response
     61   
     62    quitButton = mainMenuButton.MainMenuButton((450,170+MAIN_SHIFT*4),True,'Quit')
     63    quitButton.addResponse((pygame.quit,))
     64    quitButton.addResponse((sys.exit,))
     65   
     66       
     67   
     68    mainMenuWindow.addWindow(newGameButton)
     69    mainMenuWindow.addWindow(resumeButton)
     70    mainMenuWindow.addWindow(loadButton)
     71    mainMenuWindow.addWindow(saveButton)
     72    mainMenuWindow.addWindow(quitButton)
     73   
     74   
    4075    ###########################################################################################################
    4176   
     
    5691    buildMaterialButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*2),False,buildMaterialDescription)
    5792   
    58     buildMenu = inGameMenu.InGameMenu((20,20),False,'BUILD EMU','build.png')
     93    buildMenu = inGameMenu.InGameMenu((20,20),False,'BUILD MENU','build.png')
    5994    buildMenu.addWindow(buildPowerButton)
    6095    buildMenu.addWindow(buildTransportationButton)
     
    83118    researchMaterialButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*2),False,researchMaterialDescription)
    84119
    85     researchMenu = inGameMenu.InGameMenu((20,20),False,'RESEARCH EMU','research.png')
     120    researchMenu = inGameMenu.InGameMenu((20,20),False,'RESEARCH MENU','research.png')
    86121    researchMenu.addWindow(researchPowerButton)
    87122    researchMenu.addWindow(researchTransportationButton)
     
    102137    undoButton = onScreenButton.OnScreenButton((20 + 169*2,720), True,'UNDO TURN')
    103138   
     139    menuButton = onScreenButton.OnScreenButton((20,20),True,'MAIN MENU')
     140    menuButton.addResponse((mainMenuWindow.openWindow,))
     141    menuButton.addResponse((resumeButton.openWindow,))
     142    menuButton.addResponse((saveButton.openWindow,))
     143    menuButton.addResponse((loadButton.openWindow,))
     144    menuButton.addResponse((quitButton.openWindow,))
     145    menuButton.addResponse((newGameButton.openWindow,))
     146
    104147    newMap = map.Map((600,20),True)
    105148   
     149   
    106150    ############################################################################################
    107    
     151    newTop.addWindow(mainMenuWindow)
     152    newTop.addWindow(menuButton)
    108153    newTop.addWindow(buildButton)
    109154    newTop.addWindow(researchButton)
  • src/mainMenu.py

    r239 r261  
    2020        Window.__init__(self, pos, visible)
    2121       
    22         self.rectangles.append(Rectangle((0,0),MAIN_MENU_W,MAIN_MENU_H,GRAY))
    23         self.text.append(Text((0,15),"TECHTREK", HG_TEXT,FAKEBLACK,MAIN_MENU_W,True,0))
     22        self.rectangles.append(Rectangle(self.pos,MAIN_MENU_W,MAIN_MENU_H,GRAY))
     23        self.text.append(Text((self.pos[0],self.pos[1] + 15),"TECHTREK", HG_TEXT,FAKEBLACK,MAIN_MENU_W,True,0))
    2424                               
    2525       
Note: See TracChangeset for help on using the changeset viewer.