Mercurial > touhou
diff pytouhou/ui/gamerunner.pyx @ 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 | 1abb6f7db8cc |
children | 00f228b57840 |
line wrap: on
line diff
--- a/pytouhou/ui/gamerunner.pyx +++ b/pytouhou/ui/gamerunner.pyx @@ -165,8 +165,11 @@ cdef class GameRunner(Runner): else: self.game.run_iter([keystate]) - if self.window is not None: - self.game.interface.labels['framerate'].set_text('%.2ffps' % self.window.get_fps()) + labels = self.game.interface.labels + if self.window is not None and 'framerate' in labels: + labels['framerate'].set_text('%.2ffps' % self.window.get_fps()) + if not self.skip and self.renderer is not None: self.renderer.render(self.game) + return True