root/src/staticWindows.py @ 46

Revision 46, 5.0 KB (checked in by mmorton, 2 years ago)
Line 
1'''
2Created on Feb 23, 2012
3
4@author: TechTrek
5'''
6import pygame, os, math
7import pygame._view # something about pygame2exe...
8
9from color import *
10from ui import *
11from window import *
12from constants import *
13from windowEntry import *
14from image import *
15from text import *
16from rectangle import *
17from building import *
18from fileio import *
19from dimensions import *
20from game import *
21from state import *
22from staticWindows import *
23
24# Windows Dictionary... whatever, it works
25windowsDict = {}
26
27# create necessary windows
28backGround = Window('background',0,0)
29backGroundEntry = WindowEntry(('',False,False))
30openingArt = pygame.image.load(resourceDir + os.sep + "menu_icons" + os.sep +"intro1.jpg")
31backGroundEntry.addImage(Image((0,0),1080,792,openingArt))
32backGround.addEntry(backGroundEntry)
33windowsDict['background'] = backGround
34
35buildGameMenu = Window('buildButton',40,720)
36buildIcon = WindowEntry(('build_menu',False,False))
37buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep + "png" + os.sep + "build.png"))
38buildIcon.addImage(Image((5,5),40,40,buildArt,))
39buildIcon.addRectangle(Rectangle((0,0),220,50,BLUE))
40buildIcon.addText(Text((80,13),"BUILD",42,WHITE))
41buildGameMenu.addEntry(buildIcon)
42windowsDict['buildButton'] = buildGameMenu
43
44researchGameMenu = Window('researchButton',275,720)
45researchIcon = WindowEntry(('researchMenu',False,False))
46buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep  + "png" + os.sep +"research.png"))
47researchIcon.addImage(Image((5,5),40,40,buildArt))
48researchIcon.addRectangle(Rectangle((0,0),220,50,BLUE))
49researchIcon.addText(Text((55,13),"RESEARCH",42,WHITE))
50researchGameMenu.addEntry(researchIcon)
51windowsDict['researchButton'] = researchGameMenu
52
53#    buildMenu = Window('buildMenu',20,20)
54#    buildMenu.setDefaultResponse(('',True,True))
55#    # Hard coded for now, but eventually will be a for loop through each object
56#    buildIcon = WindowEntry(('',False,False))
57#    buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep + "png" + os.sep + "build.png"))
58#    buildIcon.addImage(Image((120,10),40,40,buildArt))
59#    buildIcon.addImage(Image((345,10),40,40,buildArt))
60#    buildIcon.addRectangle(Rectangle((0,0),MENU_W,MENU_H,BLUE))
61#    buildIcon.addText(Text((210,17),"BUILD",42,WHITE,))
62#    buildMenu.addEntry(buildIcon) 
63#    windowsDict['buildMenu'] = buildMenu 
64
65researchMenu = Window('researchMenu',20,20)
66researchMenu.setDefaultResponse(('',True,True))
67# Hard coded for now, but eventually will be a for loop through each object
68researchIcon = WindowEntry(('',False,False))
69researchArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep + "png" + os.sep + "research.png"))
70researchIcon.addImage(Image((120,10),40,40,researchArt))
71researchIcon.addImage(Image((345,10),40,40,researchArt,))
72researchIcon.addRectangle(Rectangle((0,0),MENU_W,MENU_H,BLUE))
73researchIcon.addText(Text((175,17),"RESEARCH",42,WHITE))
74researchMenu.addEntry(researchIcon)
75
76
77
78# Swifting each entry down 120
79# Each description is shifted down 30 from name
80
81researchIcon = WindowEntry(('researchPower',False,False))
82buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep + "png" + os.sep + "power.png"))
83researchIcon.addImage(Image((390,110),ICON_SIZE,ICON_SIZE,buildArt))
84researchIcon.addRectangle(Rectangle((20,100),460,100,CYAN))
85researchIcon.addText(Text((25,110),"POWER",32,WHITE))
86researchIcon.addText(Text((25,140),"This is where the text would go.",24,WHITE))
87researchMenu.addEntry(researchIcon)
88
89researchIcon = WindowEntry(('researchMoney',False,False))
90buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep + "png" + os.sep + "coins.png"))
91researchIcon.addImage(Image((390,230),ICON_SIZE,ICON_SIZE,buildArt))
92researchIcon.addRectangle(Rectangle((20,220),460,100,CYAN))
93researchIcon.addText(Text((25,230),"MONEY",32,WHITE))
94researchIcon.addText(Text((25,260),"This is where the text would go.",24,WHITE))
95researchMenu.addEntry(researchIcon)
96
97researchIcon = WindowEntry(('researchMaterial',False,False))
98buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep + "png" + os.sep + "material.png"))
99researchIcon.addImage(Image((390,350),ICON_SIZE,ICON_SIZE,buildArt))
100researchIcon.addRectangle(Rectangle((20,340),460,100,CYAN))
101researchIcon.addText(Text((25,350),"MATERIAL",32,WHITE))
102researchIcon.addText(Text((25,380),"This is where the text would go.",24,WHITE))
103researchMenu.addEntry(researchIcon)
104windowsDict['researchMenu'] = researchMenu
105
106# End Turn Button
107
108endTurn = Window('endTurn',600,720)
109endTurn.setDefaultResponse(('',False,True))
110endTurnButton = WindowEntry(('endTurnNow',False,False))
111endTurnButton.addRectangle(Rectangle((0,0),220,50,BLUE))
112endTurnButton.addText(Text((55,13),"END TURN",42,WHITE))
113endTurn.addEntry(endTurnButton)
114windowsDict['endTurn'] = endTurn
Note: See TracBrowser for help on using the browser.