Ren'Py Animated Images

Insanepenguin91

Member
Game Developer
May 18, 2017
403
3,446
Hello,
Im running into an issue on renpy - i want to show to images on loop but i keep getting an error in the coding or the second image is just ignored and the game show the next part. Please advise on the code below:

scene vero-a1 animated with fade:
"vero-a2" with dissolve
pause (1)
"vero-a1" with dissolve
pause (1)
repeat

i got it to work once but when i tried to recreate the code with another set of images it would not work
 

Nottravis

Sci-fi Smutress
Donor
Game Developer
Jun 3, 2017
5,132
27,280
You could try defining the animation and then calling it when needed instead. So something like:

image vero:
"vero-a2.png"
pause 1
"vero-a1.png"
pause 1
repeat

show vero
with dissolve

Might be worth a shot? (also I can't get the indents to work on this post so remember to do them!) :)
 

Papa Ernie

Squirrel!?
Uploader
Donor
Dec 4, 2016
12,333
48,120
You could try defining the animation and then calling it when needed instead. So something like:

image vero:
"vero-a2.png"
pause 1
"vero-a1.png"
pause 1
repeat

show vero
with dissolve

Might be worth a shot? (also I can't get the indents to work on this post so remember to do them!) :)
Pro tip: Click on the + tab in the edit bar to put code in a window that keeps the indents. Yo, Joe!
Sample:
Code:
def path_to_saves(gamedir, save_directory=None):
    import renpy  # @UnresolvedImport

    if save_directory is None:
        save_directory = renpy.config.save_directory
        save_directory = renpy.exports.fsencode(save_directory)

    # Makes sure the permissions are right on the save directory.
    def test_writable(d):
        try:
            fn = os.path.join(d, "test.txt")
            open(fn, "w").close()
            open(fn, "r").close()
            os.unlink(fn)
            return True
        except:
            return False
Pro tip #2: If there is a lot of code, you can put the code (after using the code tab) in a spoiler to save space.
Sample:
You don't have permission to view the spoiler content. Log in or register now.
 
  • Like
Reactions: Nottravis

Insanepenguin91

Member
Game Developer
May 18, 2017
403
3,446
I tried to create the image before the label
Code:
image vero:
    "vero-a1.jpg"
    pause 1
    "vero-a2.jpg"
    pause 1
    repeat
and then use it when i needed in the code
Code:
scene vero
    with dissolve
but its not working - it still skips to the next scene
 
  • Like
Reactions: Nottravis

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,566
7,378
Try either not indenting the "with dissolve" or putting it on the same line as the "scene vero"
 

Insanepenguin91

Member
Game Developer
May 18, 2017
403
3,446
Thanks everyone for their help, i got it to work. i created the image before the label

Code:
image vero1:
    "vero-a1"
    1
    "vero-a2"
    1
    repeat
then just use it when i needed in the code

Code:
show vero1 with dissolve
 
  • Like
Reactions: Cirro84

Nottravis

Sci-fi Smutress
Donor
Game Developer
Jun 3, 2017
5,132
27,280
Oops! Sorry about that! :confounded:

Glad you got it working in the end though.