Mercurial > touhou
comparison 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 |
comparison
equal
deleted
inserted
replaced
548:1e9ea6519f3c | 549:56bca8ce4b68 |
---|---|
163 if self.con is not None: | 163 if self.con is not None: |
164 self.con.run_iter(self.game, keystate) | 164 self.con.run_iter(self.game, keystate) |
165 else: | 165 else: |
166 self.game.run_iter([keystate]) | 166 self.game.run_iter([keystate]) |
167 | 167 |
168 if self.window is not None: | 168 labels = self.game.interface.labels |
169 self.game.interface.labels['framerate'].set_text('%.2ffps' % self.window.get_fps()) | 169 if self.window is not None and 'framerate' in labels: |
170 labels['framerate'].set_text('%.2ffps' % self.window.get_fps()) | |
171 | |
170 if not self.skip and self.renderer is not None: | 172 if not self.skip and self.renderer is not None: |
171 self.renderer.render(self.game) | 173 self.renderer.render(self.game) |
174 | |
172 return True | 175 return True |