root/src/staticWindows.py @ 54

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