Page 1 of 1

How to make a loopable animation after a particular frame?

Posted: Mon Feb 13, 2017 11:42 am
by asatiir
Hi,

There's an animated sprite I made with two separate animations, one that starts the animation and the other loops after. I've had two solutions (neither of which I know how to do and would appreciate the help):

- Make two separate image labels and tell renpy to play one after another (I tried show-pause-hide, but that somehow skipped a few frames.)
- make one label and somehow tell it to repeat between specific frames (which I don't know how)

I don't know an effective way to do either and I'm not sure if there's a better way, would anyone know? thanks.

Re: How to make a loopable animation after a particular fram

Posted: Mon Feb 13, 2017 11:49 am
by Ocelot
You want a block statement: https://www.renpy.org/doc/html/atl.html#block-statement

something like:

Code: Select all

image animation:
    'frame 1.png'
    0.2
    'frame 2.png'
    block:
        0.2
        'frame 3.png'
        0.2
        'frame 4.png'
        repeat
It will show first two frames and then repeat frames 3 and 4.

Re: How to make a loopable animation after a particular fram

Posted: Mon Feb 13, 2017 12:04 pm
by asatiir
Ocelot wrote:You want a block statement: https://www.renpy.org/doc/html/atl.html#block-statement

something like:

Code: Select all

image animation:
    'frame 1.png'
    0.2
    'frame 2.png'
    block:
        0.2
        'frame 3.png'
        0.2
        'frame 4.png'
        repeat
It will show first two frames and then repeat frames 3 and 4.
This worked! thanks a lot!

edit: okay that solved on problem and brought another, now when I try to move the animation it starts the nimation from the very beginning. Is there a way to leave it to loop the block when moving?