Merge pull request #101 from arturo182/patch-1

sequence: Add a function to play the previous animation
This commit is contained in:
foamyguy 2022-10-24 11:28:54 -05:00 committed by GitHub
commit 795be500a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,6 +179,13 @@ class AnimationSequence:
self.on_cycle_complete() self.on_cycle_complete()
self.activate(current % len(self._members)) self.activate(current % len(self._members))
def previous(self):
"""
Jump to the previous animation.
"""
current = self._current - 1
self.activate(current % len(self._members))
def random(self): def random(self):
""" """
Jump to a random animation. Jump to a random animation.