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

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
omranpanda
Newbie
Posts: 15
Joined: Tue Nov 03, 2020 4:29 pm
Contact:

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

#1 Post 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
Last edited by omranpanda on Thu Sep 23, 2021 1:00 pm, edited 1 time in total.

omranpanda
Newbie
Posts: 15
Joined: Tue Nov 03, 2020 4:29 pm
Contact:

Re: How to create an infinitely scrolling image?

#2 Post 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.

jeffster
Veteran
Posts: 361
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: How to create an infinitely scrolling image?

#3 Post 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!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]