Changeset 189

Show
Ignore:
Timestamp:
03/17/2012 04:13:31 PM (2 years ago)
Author:
jelinson
Message:

created constants for font sizes

Files:
9 modified

Legend:

Unmodified
Added
Removed
  • .pydevproject

    r174 r189  
    44<pydev_project> 
    55<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> 
    6 <path>/mt</path> 
    7 <path>/mt/src</path> 
     6<path>/cs121sp2012_5</path> 
     7<path>/cs121sp2012_5/src</path> 
    88</pydev_pathproperty> 
    99<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property> 
  • src/alert.py

    r188 r189  
    3737        alertIcon = WindowEntry(Response('windows',[],False,False)) 
    3838        alertIcon.addRectangle(Rectangle((0,0),500, 150,YELLOW)) 
    39         alertIcon.addText(Text((10,20),'MESSAGE',32,FAKEBLACK)) 
    40         alertIcon.addText(Text((30,60),self.text,24,FAKEBLACK,400)) 
     39        alertIcon.addText(Text((10,20),'MESSAGE',MD_TEXT,FAKEBLACK)) 
     40        alertIcon.addText(Text((30,60),self.text,MD_TEXT,FAKEBLACK,400)) 
    4141        alertWindow.addEntry(alertIcon) 
    4242        if self.options == True: 
  • src/font.py

    r184 r189  
    66 
    77FONT_NAME = None #"comicsansms" 
     8 
     9SM_TEXT = 24 
     10MD_TEXT = 32 
     11LG_TEXT = 42 
     12XLG_TEXT = 72 
  • src/globals.py

    r186 r189  
    99from constants import * 
    1010from color import * 
     11from font import * 
    1112 
    1213# DEBUG 
     
    1718# 4 == game 
    1819# 5 == NONE 
    19 DEBUG = 5 
     20DEBUG = 0 
  • src/main.py

    r186 r189  
    3434        print "Font Error" 
    3535         
    36     print pygame.font.get_fonts() 
    37     #print pygame.font.match_font("timesnewroman") 
    3836     
    3937    # initialize the screen with the correct initial dimensions 
     
    158156                    sys.exit() 
    159157                     
    160                  
    161                      
    162158                # otherwise, our response is 'windows' 
    163159                else: 
  • src/scene.py

    r150 r189  
    4949        landscape = WindowEntry(Response('windows',[],False,False)) 
    5050        landscape.addImage(Image((0, 0),ORIG_SCREEN_W,ORIG_SCREEN_H,landscapeArt)) 
    51         landscape.addText(Text((10, 17), self.introSceneText[sceneNumber - 1], 42, WHITE, ORIG_SCREEN_W - 20)) 
     51        landscape.addText(Text((10, 17), self.introSceneText[sceneNumber - 1], LG_TEXT, WHITE, ORIG_SCREEN_W - 20)) 
    5252        sceneWindow.addEntry(landscape) 
    5353         
     
    5959        backButton = WindowEntry(backWindowResponse) 
    6060        backButton.addRectangle(Rectangle((20, 120), 56, 25, GRAY)) 
    61         backButton.addText(Text((28, 125), 'BACK', 24, FAKEBLACK, ORIG_SCREEN_W - 20)) 
     61        backButton.addText(Text((28, 125), 'BACK', SM_TEXT, FAKEBLACK, ORIG_SCREEN_W - 20)) 
    6262        sceneWindow.addEntry(backButton) 
    6363         
     
    6969        nextButton = WindowEntry(nextWindowResponse) 
    7070        nextButton.addRectangle(Rectangle((SCREEN_W - 76, 120), 56, 25, GRAY)) 
    71         nextButton.addText(Text((SCREEN_W - 72, 125), 'NEXT', 24, FAKEBLACK, ORIG_SCREEN_W - 20)) 
     71        nextButton.addText(Text((SCREEN_W - 72, 125), 'NEXT', SM_TEXT, FAKEBLACK, ORIG_SCREEN_W - 20)) 
    7272        sceneWindow.addEntry(nextButton) 
    7373         
     
    8989        landscape = WindowEntry(Response('windows',[],False,False)) 
    9090        landscape.addImage(Image((0,0),ORIG_SCREEN_W,ORIG_SCREEN_H,landscapeArt)) 
    91         landscape.addText(Text((10,17),self.pollutionSceneText[sceneNumber - 1],42,WHITE)) 
     91        landscape.addText(Text((10,17),self.pollutionSceneText[sceneNumber - 1], LG_TEXT, WHITE)) 
    9292        sceneWindow.addEntry(landscape) 
    9393         
     
    9797            backButton = WindowEntry(backWindowResponse) 
    9898            backButton.addRectangle(Rectangle((20,120),56,25,GRAY)) 
    99             backButton.addText(Text((28,125),'BACK',24,FAKEBLACK)) 
     99            backButton.addText(Text((28,125),'BACK', SM_TEXT, FAKEBLACK)) 
    100100            sceneWindow.addEntry(backButton) 
    101101         
     
    107107        nextButton = WindowEntry(nextWindowResponse) 
    108108        nextButton.addRectangle(Rectangle((SCREEN_W - 76,120),56,25,GRAY)) 
    109         nextButton.addText(Text((SCREEN_W - 72,125),'NEXT',24,FAKEBLACK)) 
     109        nextButton.addText(Text((SCREEN_W - 72,125),'NEXT', SM_TEXT, FAKEBLACK)) 
    110110        sceneWindow.addEntry(nextButton) 
    111111         
     
    126126        landscape = WindowEntry(Response('windows',[],False,False)) 
    127127        landscape.addImage(Image((0,0),ORIG_SCREEN_W,ORIG_SCREEN_H,landscapeArt)) 
    128         landscape.addText(Text((10,17),self.winSceneText[sceneNumber - 1],42,WHITE)) 
     128        landscape.addText(Text((10,17),self.winSceneText[sceneNumber - 1], LG_TEXT, WHITE)) 
    129129        sceneWindow.addEntry(landscape) 
    130130         
     
    134134            backButton = WindowEntry(backWindowResponse) 
    135135            backButton.addRectangle(Rectangle((20,120),56,25,GRAY)) 
    136             backButton.addText(Text((28,125),'BACK',24,FAKEBLACK)) 
     136            backButton.addText(Text((28,125),'BACK', SM_TEXT, FAKEBLACK)) 
    137137            sceneWindow.addEntry(backButton) 
    138138         
     
    144144        nextButton = WindowEntry(nextWindowResponse) 
    145145        nextButton.addRectangle(Rectangle((SCREEN_W - 76,120),56,25,GRAY)) 
    146         nextButton.addText(Text((SCREEN_W - 72,125),'NEXT',24,FAKEBLACK)) 
     146        nextButton.addText(Text((SCREEN_W - 72,125),'NEXT', SM_TEXT, FAKEBLACK)) 
    147147        sceneWindow.addEntry(nextButton) 
    148148         
  • src/spinner.py

    r188 r189  
    3737        background = WindowEntry(Response('windows',[],False,False)) 
    3838        background.addRectangle(Rectangle((0,0),460,100,CYAN)) 
    39         background.addText(Text((5,10),'Research ' + CAT_LUT[self.researchType],32,WHITE)) 
    40         background.addText(Text((5,40), "Some text about how much to invest to get new technology.",24,WHITE, 200)) 
    41         background.addText(Text((230,20), str(self.currentValue),72,WHITE, 200)) 
     39        background.addText(Text((5,10),'Research ' + CAT_LUT[self.researchType], LG_TEXT,WHITE)) 
     40        background.addText(Text((5,40), "Some text about how much to invest to get new technology.", SM_TEXT, WHITE, 200)) 
     41        background.addText(Text((230,20), str(self.currentValue), XLG_TEXT, WHITE, 200)) 
    4242        buildArt = pygame.image.load(os.path.abspath(iconDir + os.sep + CAT_LUT[self.researchType] + '.png')) 
    4343        background.addImage(Image((370,10),ICON_SIZE,ICON_SIZE,buildArt)) 
     
    5252        incrementButton = WindowEntry(Response('spinner',[],False,False,'increment')) 
    5353        incrementButton.addRectangle(Rectangle((300,6),25,30,YELLOW)) 
    54         incrementButton.addText(Text((300,2),'^',72,FAKEBLACK,300+25,True,300)) 
     54        incrementButton.addText(Text((300,2),'^', XLG_TEXT, FAKEBLACK,300+25,True,300)) 
    5555        researchWindow.addEntry(incrementButton) 
    5656         
    5757        decrementButton = WindowEntry(Response('spinner',[],False,False,'decrement')) 
    5858        decrementButton.addRectangle(Rectangle((300,40),25,30,YELLOW)) 
    59         decrementButton.addText(Text((300,28),'v',72,FAKEBLACK,300+25,True,300)) 
     59        decrementButton.addText(Text((300,28),'v', XLG_TEXT, FAKEBLACK,300+25,True,300)) 
    6060        researchWindow.addEntry(decrementButton) 
    6161         
  • src/staticWindows.py

    r188 r189  
    9494researchIcon.addImage(Image((345,10),IMG_SM,IMG_SM,researchArt,)) 
    9595researchIcon.addRectangle(Rectangle((0,0),GAME_MENU_W,GAME_MENU_H,BLUE)) 
    96 researchIcon.addText(Text((0,17),"RESEARCH",42,WHITE,GAME_MENU_W,True,0)) 
     96researchIcon.addText(Text((0,17),"RESEARCH", LG_TEXT,WHITE,GAME_MENU_W,True,0)) 
    9797researchMenu.addEntry(researchIcon) 
    9898 
     
    103103    researchIcon.addImage(Image((390,110+ENTRY_SHIFT*i),ICON_SIZE,ICON_SIZE,researchArt)) 
    104104    researchIcon.addRectangle(Rectangle((20,100+ENTRY_SHIFT*i),ENTRY_W,ENTRY_H,CYAN)) 
    105     researchIcon.addText(Text((25,110+ENTRY_SHIFT*i),cat[i].upper(),32,WHITE)) 
    106     researchIcon.addText(Text((25,140+ENTRY_SHIFT*i),"This is where the text would go. It is going to be on multiple lines because Erin is curious.",24,WHITE,300)) 
     105    researchIcon.addText(Text((25,110+ENTRY_SHIFT*i),cat[i].upper(), MD_TEXT, WHITE)) 
     106    researchIcon.addText(Text((25,140+ENTRY_SHIFT*i),"This is where the text would go. It is going to be on multiple lines because Erin is curious.", SM_TEXT,WHITE,300)) 
    107107    researchMenu.addEntry(researchIcon) 
    108108windowsDict['researchMenu'] = researchMenu 
     
    117117buildIcon.addImage(Image((345,10),IMG_SM,IMG_SM,buildArt)) 
    118118buildIcon.addRectangle(Rectangle((0,0),GAME_MENU_W,GAME_MENU_H,BLUE)) 
    119 buildIcon.addText(Text((0,17),"BUILD",42,WHITE,GAME_MENU_W,True,0)) 
     119buildIcon.addText(Text((0,17),"BUILD", LG_TEXT,WHITE,GAME_MENU_W,True,0)) 
    120120buildMenu1.addEntry(buildIcon) 
    121121 
     
    125125    buildIcon.addImage(Image((390,110+ENTRY_SHIFT*i),ICON_SIZE,ICON_SIZE,buildArt)) 
    126126    buildIcon.addRectangle(Rectangle((20,100+ENTRY_SHIFT*i),ENTRY_W,ENTRY_H,CYAN)) 
    127     buildIcon.addText(Text((25,110+ENTRY_SHIFT*i),cat[i].upper(),32,WHITE)) 
    128     buildIcon.addText(Text((25,140+ENTRY_SHIFT*i),"This is where the text would go.",24,WHITE,300)) 
     127    buildIcon.addText(Text((25,110+ENTRY_SHIFT*i),cat[i].upper(), MD_TEXT, WHITE)) 
     128    buildIcon.addText(Text((25,140+ENTRY_SHIFT*i),"This is where the text would go.", SM_TEXT, WHITE,300)) 
    129129    buildMenu1.addEntry(buildIcon) 
    130130windowsDict['buildMenu1'] =buildMenu1 
     
    136136mainIcon = WindowEntry(Response('windows',[],False,False)) 
    137137mainIcon.addRectangle(Rectangle((0,0),MAIN_MENU_W,MAIN_MENU_H,GRAY)) 
    138 mainIcon.addText(Text((0,15),"TECHTREK",72,FAKEBLACK,MAIN_MENU_W,True,0)) 
     138mainIcon.addText(Text((0,15),"TECHTREK", XLG_TEXT,FAKEBLACK,MAIN_MENU_W,True,0)) 
    139139mainMenu.addEntry(mainIcon) 
    140140 
  • src/turnMenu.py

    r188 r189  
    3838        buildIcon.addImage(Image((345,10),40,40,buildArt)) 
    3939        buildIcon.addRectangle(Rectangle((0,0),GAME_MENU_W,GAME_MENU_H,BLUE)) 
    40         buildIcon.addText(Text((0,17),CAT_LUT[researchType].upper(),42,WHITE,GAME_MENU_W,True,0)) 
     40        buildIcon.addText(Text((0,17),CAT_LUT[researchType].upper(), LG_TEXT,WHITE,GAME_MENU_W,True,0)) 
    4141        buildMenu.addEntry(buildIcon) 
    4242        buildables = self.calculateBuildables(state) 
     
    5050                buildIcon.addImage(Image((390,110+ENTRY_SHIFT*i),ICON_SIZE,ICON_SIZE,buildArt)) 
    5151                buildIcon.addRectangle(Rectangle((20,100+ENTRY_SHIFT*i),460,100,CYAN)) 
    52                 buildIcon.addText(Text((25,110+ENTRY_SHIFT*i),building.name,32,WHITE)) 
    53                 buildIcon.addText(Text((25,140+ENTRY_SHIFT*i), building.menuDescript,24,WHITE)) 
     52                buildIcon.addText(Text((25,110+ENTRY_SHIFT*i),building.name, MD_TEXT, WHITE)) 
     53                buildIcon.addText(Text((25,140+ENTRY_SHIFT*i), building.menuDescript, MD_TEXT, WHITE)) 
    5454                buildMenu.addEntry(buildIcon) 
    5555                i += 1 
     
    8282        buildIcon.addImage(Image((370,10),ICON_SIZE,ICON_SIZE,buildArt)) 
    8383        buildIcon.addRectangle(Rectangle((0,0),460,100,CYAN)) 
    84         buildIcon.addText(Text((5,10),name,32,WHITE)) 
    85         buildIcon.addText(Text((5,40), buildingLUT[name].detailedDescript,24,WHITE, 350)) 
     84        buildIcon.addText(Text((5,10),name, MD_TEXT, WHITE)) 
     85        buildIcon.addText(Text((5,40), buildingLUT[name].detailedDescript, SM_TEXT, WHITE, 350)) 
    8686        descriptionWindow.addEntry(buildIcon) 
    8787