Hello,
I have not given up on this project yet and have made a few attempts to add a transformation, without success, or with the above behavior. Adding With(Dissolve(0.5)) in the function itself (outside the screen, during synchronization) brought the desired effect. Unfortunately not inside the screen during normal animation, so it's not really usable. ^.^
As luck would have it, I stumbled across a function on reddit that would be much better (for compatibility reasons) if only I understood how these animations work...
Basically, it creates a list and searches the specified location for images to add to that list, also adds a pause timer and the desired transition effet. The nice thing is, as soon as we call "show image_name" the animation is started at the
first image, but we still don't know which image is currently shown, so we can't do any synchronization.
I tried to find out with the help of the console which image is currently shown:
$x = renpy.list_images()
print x
As output, a list with all images is displayed.
e.g [u'black', u'calm_palm', u_calm_palm1', u'calm_palm2', ....and so on]
So there MUST be a counter somewhere that is used to display the current image. But where? And what is its defined name?
Now that a list is shown, I tried the following (also in the console) while the animation "palm_calm" is displayed:
$x = renpy.showing("palm_calm")
print x
output:
True
and waited until calm_palm2 is visible on the screen:
$x = renpy.showing("palm_calm2")
print x
output:
None # ?!
I repeated this process a few times and I don't understand why the answer is always None.
Maybe a Renpy expert can help us with this, that would be really great.
Have a nice day and don't give up, Iam nearly sure there IS a way
Greetings
Code: Select all
# function found on reddit you may use google search "renpy.display.anim.TransitionAnimation"
init python:
def Animation(prefix, fps=24, trans=None):
import os
pause = 1.0 / fps
chain = [] # creates a List "chain[]"
for fn in renpy.list_files(): # for, next loop to read images from path
if not fn.startswith(prefix):
continue
basename = os.path.basename(fn)
base, ext = os.path.splitext(basename)
if not ext.lower() in [ ".jpg", ".jpeg", ".png", ".webp" ]:
continue
chain.extend([fn, pause, trans]) # append image, fps, transition
return renpy.display.anim.TransitionAnimation(*chain) # <- ┌ not documented ofc...
# └ but works like a charm
####################
# define image-sequences with function Animation()
# change fps to slow down or speed up, same with Dissolve
image palm_calm = Animation("images/palm_calm", fps=1, trans=Dissolve(1.0))
image palm_storm = Animation("images/palm_storm", fps=1, trans=Dissolve(1.0))
####################
label anim_test:
show palm_calm:
xalign 0.5 yalign 0.5
with dissolve
"Image seq: palm_calm - sequence starts with picture 1."
show palm_storm:
xalign 0.5 yalign 0.5
hide palm_calm
with dissolve
"Image seq: palm_storm sequence also starts with picture 1."
"That's great. Now we need to find out which image is displayed at the time of the player click."
return
Alem wrote: ↑Sat Jan 29, 2022 3:42 pm
Yeah, I had the same problem with extra clicks >< Also, I can report a pretty strange issue with animation slowing down after playing for some time. There’s no jitter or jerking between frames, the whole thing just slows down on its own and goes back to the original speed after a bit of time.
ps. I forgot to insert a quote for your notification.