If you're having trouble or run into any bugs with the code, post a comment here! I will try to get back to you within a few days.
Add parallax to viewports in Ren'Py. · By
Hello! I did not code the viewport with this in mind, but it's definitely an interesting proposition. I will keep it in mind for a potential future update! In the meantime you can potentially experiment with the xpan property outside of the viewport, which does seamlessly loop images. It won't work with how the viewport is set up currently, since it's expecting a fixed-size displayable.
That's great to hear! I will keep this tidbit in mind when I develop a future visual novel with this script!
Sorry
that I haven't mentioned this before suggesting this, but maybe
in this potential future update you could consider expanding this
parallax code to image scenes as well? Image scenes as
in, scenes and labels that have image displayables representing backgrounds and characters that you change
expressions of? I did try to insert a LayeredImage placeholder
into this parallax viewport, and it did work! With the limits of being
an image on a screen of course (Can't move around unless animated by
transforms, 'mouth-flapping' and other codes that involve changing images in a scene don't work, etc)
(this question probably sounds a bit advanced and probably a different utility entirely since I suspect it might involve rewriting the code of the entire thing, but it could be possible...)
Hello!
This is a really cool effect, but I was wondering if it's possible to get this to work with dialogue? I've been playing around with using this in a project but I won't be able to unless I can get it to work with labels that have dialogue :( I'm also curious what exactly could be causing the issues?
Hi! Thanks for the fast response!
Basically, we're making a point-and-click type game, but were hoping to use a parallax screen as our background instead of just a static scene image. The viewport method has worked great so far, with the furniture in the room being layered and moving as expected, and imagebuttons working as interactable items.
I'm still fairly new to renpy, so maybe I'm missing something obvious or grossly misunderstanding something, but generally showing screens alongside dialogue in labels works fine, but it doesn't with screens that have this viewport. Do you know why that is??
If you show a screen, it shows on the screens layer, which by default is above things like character sprites on the master layer. This is true of all screens, but you might not have run into problems before if you weren't using full background images in the screen. It can also show on top of the dialogue depending on the zorder (higher zorder goes on top of screens with lower zorder).
Ah I see, thank you! You're right, there is probably some kind of layering or zorder issue somewhere. I also have a hunch now that one of my screens being modal might have also had something to do with it.
I ended up using an alternative method to acheive the effect, but thank you for your help! I might still come back to this in future for other projects.