diff pytouhou/ui/sdl/gamerenderer.py @ 549:56bca8ce4b68

Add a very simple sample interface.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 08 Nov 2013 18:48:30 +0100
parents b895ed2de71f
children 0d7a16e0f834
line wrap: on
line diff
--- a/pytouhou/ui/sdl/gamerenderer.py
+++ b/pytouhou/ui/sdl/gamerenderer.py
@@ -75,13 +75,15 @@ class GameRenderer(object):
 
 
     def render_interface(self, interface, boss):
-        interface.labels['framerate'].set_text('%.2ffps' % self.window.get_fps())
+        interface_labels = interface.labels
+        if 'framerate' in interface_labels:
+            interface_labels['framerate'].set_text('%.2ffps' % self.window.get_fps())
 
         self.window.win.render_set_viewport(Rect(0, 0, interface.width, interface.height))
         self.window.win.render_set_clip_rect(Rect(0, 0, interface.width, interface.height))
 
         items = [item for item in interface.items if item.anmrunner and item.anmrunner.running]
-        labels = interface.labels.values()
+        labels = interface_labels.values()
 
         if items:
             # Redraw all the interface