comparison light8/stage.py @ 10:533ac835083f

some real lights
author drewp
date Sun, 07 Jul 2002 05:14:46 +0000
parents 6faae180d1c5
children 95ba7e14d15a
comparison
equal deleted inserted replaced
9:342f7d1c7561 10:533ac835083f
92 # 92 #
93 def leftpress(self,ev): 93 def leftpress(self,ev):
94 94
95 self.lmbstate='pressed' 95 self.lmbstate='pressed'
96 self.lmbstart=(ev.x,ev.y) 96 self.lmbstart=(ev.x,ev.y)
97 print "click at",self.lmbstart
97 98
98 shifted=ev.state & 1 99 shifted=ev.state & 1
99 control=ev.state & 4 100 control=ev.state & 4
100 touching=self.findoverlappinglights((ev.x-self.halo,ev.y-self.halo,ev.x+self.halo,ev.y+self.halo)) 101 touching=self.findoverlappinglights((ev.x-self.halo,ev.y-self.halo,ev.x+self.halo,ev.y+self.halo))
101 istouching=len(touching)>0 102 istouching=len(touching)>0
238 root=Tk() 239 root=Tk()
239 root.wm_geometry("+376+330") 240 root.wm_geometry("+376+330")
240 s=Stage(root) 241 s=Stage(root)
241 s.setimage('guysanddolls.gif') 242 s.setimage('guysanddolls.gif')
242 s.pack() 243 s.pack()
243 s.addlight('drew',(330,640),(90,20)) 244
244 s.addlight('house',(360,640)) 245 s.addlight('desk1',(46, 659), aim=(210, 381))
245 s.addlight('barn',(390,640)) 246 s.addlight('marry1',(78, 661), aim=(398, 428))
247 s.addlight('b13',(110, 661))
248 s.addlight('hotbox1',(147, 657), aim=(402, 327))
249 s.addlight('edge',(179, 651), aim=(116, 441))
250 s.addlight('phone',(214, 652), aim=(651, 417))
251 s.addlight('cuba1',(315, 656), aim=(559, 407))
252 s.addlight('b22',(347, 661), aim=(247, 458))
253 s.addlight('b23',(379, 661))
254 s.addlight('b24',(417, 661))
255 s.addlight('b25',(455, 658), aim=(520, 466))
256 s.addlight('desk2',(490, 655), aim=(237, 375))
257 s.addlight('rock',(571, 655), aim=(286, 304))
258 s.addlight('b32',(606, 650))
259 s.addlight('hotbox2',(637, 650), aim=(433, 337))
260 s.addlight('b34',(671, 651))
261 s.addlight('marry2',(703, 651), aim=(429, 426))
262 s.addlight('cuba2',(733, 652), aim=(602, 408))
263
246 264
247 root.mainloop() 265 root.mainloop()