changeset 275:d78ce15bccc8

Crew quarters background and toolbar on the rect tool.
author Jeremy Thurgood <firxen@gmail.com>
date Fri, 27 Aug 2010 21:57:13 +0200
parents 8f7936e5d615
children 75f4ee46ac58
files gamelib/scenes/crew_quarters.py tools/rect_drawer.py
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/scenes/crew_quarters.py	Fri Aug 27 21:47:21 2010 +0200
+++ b/gamelib/scenes/crew_quarters.py	Fri Aug 27 21:57:13 2010 +0200
@@ -9,7 +9,7 @@
 class CrewQuarters(Scene):
 
     FOLDER = "crew_quarters"
-    BACKGROUND = None # TODO
+    BACKGROUND = "crew_quarters.png"
 
     INITIAL_DATA = {
         'accessible': True,
--- a/tools/rect_drawer.py	Fri Aug 27 21:47:21 2010 +0200
+++ b/tools/rect_drawer.py	Fri Aug 27 21:57:13 2010 +0200
@@ -89,6 +89,7 @@
         self.draw_rects = True
         self.draw_things = True
         self.draw_images = True
+        self.draw_toolbar = True
 
     def toggle_things(self):
         self.draw_things = not self.draw_things
@@ -99,6 +100,9 @@
     def toggle_rects(self):
         self.draw_rects = not self.draw_rects
 
+    def toggle_toolbar(self):
+        self.draw_toolbar = not self.draw_toolbar
+
 
     def draw_mode(self):
         self.mode = 'draw'
@@ -140,6 +144,12 @@
                     cropped_rect = self.current_image.rect.clip(surface.get_rect())
                     sub = surface.subsurface(cropped_rect)
                     self.current_image.draw(sub)
+        if self.draw_toolbar:
+            toolbar_rect = pygame.rect.Rect(0, 550, 800, 50)
+            tb_surf = surface.subsurface(0, 550, 800, 50).convert_alpha()
+            tb_surf.fill(Color(127, 0, 0, 127))
+            surface.blit(tb_surf)
+            frame_rect(surface, (127, 0, 0), toolbar_rect, 5)
 
     def _make_dict(self):
         d = {}
@@ -293,6 +303,8 @@
     app.add(toggle_images)
     toggle_rects = make_button("Toggle Rects", image.toggle_rects, 440)
     app.add(toggle_rects)
+    toggle_toolbar = make_button("Toggle Toolbar", image.toggle_toolbar, 480)
+    app.add(toggle_toolbar)
     quit_but = make_button("Quit", app.quit, 560)
     app.add(quit_but)
     app.run()