@staticmethod
def _time_event(dt, self):
    """The timer callback.
        """
    if not self._is_active:
        return
    if self.viewer_flags['record']:
        self._record()
    if self.viewer_flags['rotate'] and not self.viewer_flags['mouse_pressed']:
        self._rotate()
    if self._message_text is not None:
        if self._message_opac > 1.0:
            self._message_opac -= 1.0
        else:
            self._message_opac *= 0.9
        if self._message_opac < 0.05:
            self._message_opac = 1.0 + self._ticks_till_fade
            self._message_text = None
    if self._should_close:
        self.on_close()
    else:
        self.on_draw()
