class CheckTracksApplicationWindow(object): def __init__(self, noteSequence): super(CheckTracksApplicationWindow, self).__init__() self._log = logging.getLogger("keyzer:CheckTracksApplicationWindow") self._window = pyglet.window.Window(WINDOW_SIZE[0], WINDOW_SIZE[1], caption=WINDOW_CAPTION) self._songScore = CheckTracksSongScore(0, 0, WINDOW_SIZE[0], WINDOW_SIZE[1], noteSequence) self._fps_display = pyglet.clock.ClockDisplay() @self._window.event def on_draw(): self._log.debug("on_draw") self._window.clear() self._songScore.draw() self._fps_display.draw() @self._window.event def on_key_release(symbol, modifiers): if symbol == key.ESCAPE: self._window.has_exit = True def start(self): pyglet.clock.schedule_interval(self.update, 1.0 / 60) pyglet.app.run() def update(self, dt): self._log.debug("update") self._songScore.update(dt)
def __init__(self, noteSequence): super(CheckTracksApplicationWindow, self).__init__() self._log = logging.getLogger("keyzer:CheckTracksApplicationWindow") self._window = pyglet.window.Window(WINDOW_SIZE[0], WINDOW_SIZE[1], caption=WINDOW_CAPTION) self._songScore = CheckTracksSongScore(0, 0, WINDOW_SIZE[0], WINDOW_SIZE[1], noteSequence) self._fps_display = pyglet.clock.ClockDisplay() @self._window.event def on_draw(): self._log.debug("on_draw") self._window.clear() self._songScore.draw() self._fps_display.draw() @self._window.event def on_key_release(symbol, modifiers): if symbol == key.ESCAPE: self._window.has_exit = True