comparison gamelib/gamegui.py @ 245:c39599854a2d

Better 'You've Won' Screen
author Neil Muller <drnlmuller@gmail.com>
date Sun, 13 May 2012 00:43:30 +0200
parents 05afa7ae5df3
children 235b1faf590e
comparison
equal deleted inserted replaced
244:330a63dc176e 245:c39599854a2d
431 431
432 def _make_win_screen(self, turn, msg): 432 def _make_win_screen(self, turn, msg):
433 # Clear existing widgets, and turn this into a won screen 433 # Clear existing widgets, and turn this into a won screen
434 for child in self.children[:]: 434 for child in self.children[:]:
435 self.remove_child(child) 435 self.remove_child(child)
436 # Replace background
437 self.background_image = load_image('images/main_background.jpg')
436 exitbut = ExitGameButton() 438 exitbut = ExitGameButton()
439 # FIXME: 1:20 minutes to hackery here
440 exitbut.rect.topleft = (500, 350)
437 self.add_child(exitbut) 441 self.add_child(exitbut)
438 title = TextLabel((200, 20, 400, 50), "Results for turn %d" % turn, 442 title = TextLabel((500, 20, 200, 50), "Results for turn %d" % turn,
439 font_medium, (255, 255, 255)) 443 font_medium, (255, 255, 255))
440 self.add_child(title) 444 self.add_child(title)
441 won = TextBox((200, 200, 400, 50), "You've succeeded in your quest", 445 won = TextBox((400, 200, 400, 50), "You've succeeded in your quest",
442 font_large, (255, 255, 255)) 446 font_large, (255, 255, 255))
443 self.add_child(won) 447 self.add_child(won)
444 won = TextBox((200, 250, 400, 50), msg, font_large, 448 won = TextBox((450, 250, 400, 50), msg, font_large,
445 (255, 255, 255)) 449 (255, 255, 255))
446 self.add_child(won) 450 self.add_child(won)
447 451
448 452
449 class GameStateWindow(Window): 453 class GameStateWindow(Window):