Code: Select all
class movSprite():
# Note that the alpha mask file must have the same name as the animation but with an extra ' mask' at the end.
# Example for the two files: 'directory/saki serious smile' and 'directory/saki serious smile mask'
# endStill should also be named same as the animation file, but with an added ' still' at the end.
def __init__(self, animation, duration):
self._movEnd = False
self._creationTime = time.time()
self._duration = duration
# Names of the displayables
self._movName = animation
self._endStillName = animation+'still'
# Create the still image displayable, movie should already be pre-defined in the 'init'
self._endStill = renpy.image(self._endStillName, animation+" still.png")
def showSprite(self):
#Add a check to see if previous sprite name is the same is new one to prevent same animation from replaying awkwardly
renpy.show(self._movName)
renpy.pause(self._duration)
renpy.show(self._endStillName)
def changeSprite(self, newName, duration):
#Add a check to see if previous sprite name is the same is new one to prevent same animation from replaying awkwardly (set self._movEnd)
self._movName = newName
self._duration = duration