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
[Solved!] How to create an infinitely scrolling image?
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.
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.
-
- Newbie
- Posts: 15
- Joined: Tue Nov 03, 2020 4:29 pm
- Contact:
[Solved!] How to create an infinitely scrolling image?
Last edited by omranpanda on Thu Sep 23, 2021 1:00 pm, edited 1 time in total.
-
- Newbie
- Posts: 15
- Joined: Tue Nov 03, 2020 4:29 pm
- Contact:
Re: How to create an infinitely scrolling image?
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:
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.
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
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?
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, likeomranpanda 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.
Code: Select all
align (0.5, 1.0)
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!
Who is online
Users browsing this forum: Alex