def queue(self, when, func, relative=True):
"""
Queue an event some number of frames in the future.
:param when: The number of frames in the future to perform the event
:param func: The thing to do in the future
:param relative: Optional. If set to false, `when` serves as an absolute timestamp since
play started instead of a relative count.
If func is a callable object, it will be called.
If func is a tuple, `self.play()` will be called with the tuple contents as args
Other wise, `self.play()` will be called with func as an argument.
"""
if relative: when += self.frame
bisect.insort(self.callbacks, (-when, func))
评论列表
文章目录