Page 1 of 1

[Solved!] How to create an infinitely scrolling image?

Posted: Thu Sep 16, 2021 9:06 am
by omranpanda
Hello!

As what the subject says, does anyone know how to create an infinitely scrolling image? Something similar to this:
https://youtu.be/8ppKSy8aUZc?t=236

Re: How to create an infinitely scrolling image?

Posted: Thu Sep 23, 2021 12:59 pm
by omranpanda
Hello guys!

I've finally found the solution when I've asked RenpyTom on the Renpy Discord server.

Basically you just need to use the xpan ATL (or ypan if you want it to be moving vertically.).

Here is the code:

Code: Select all

transform loopz:
    xpan -180
    linear 5.0 xpan 180
    repeat
Yup, it's as simple as that ;!; . I don't know how I've missed this, but we move.

Keep in mind that if you were to use an image with contain blocks of differing sizes, it won't work (At least it did not work in my case with one image being wider than the screen and another being the size of a normal sprite.) So if you want to use multiple images in one image, then I'd recommend that you would use something like Composite: https://www.renpy.org/doc/html/displaya ... #Composite in order for it to work.

Re: How to create an infinitely scrolling image?

Posted: Thu Sep 23, 2021 2:21 pm
by jeffster
omranpanda wrote: Thu Sep 23, 2021 12:59 pm Keep in mind that if you were to use an image with contain blocks of differing sizes, it won't work (At least it did not work in my case with one image being wider than the screen and another being the size of a normal sprite.) So if you want to use multiple images in one image, then I'd recommend that you would use something like Composite: https://www.renpy.org/doc/html/displaya ... #Composite in order for it to work.
Thank you very much for this advice. Today I tried to add some animated slideshow to my game, as it gives very interesting visual impressions. I was disappointed with how buggy it was. For instance, I can't give an initial offset to a large picture, like

Code: Select all

align (0.5, 1.0)
It appears OK by y-axis (showing its lower part), but the x alignment remains at the left.

There were other issues - with zooming and moving large images - so I was ready to drop that and resort to using some pre-made video. Now I added transparent parts in unused parts of smaller images, and it lessened the problems, to a degree. (That aligning still doesn't work properly though.)

Thank you!