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.
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.
Hello! I've been messing around with this tool and I think it's really cool. I know this is like a year later, but I was wondering if you knew how to make the viewport inactive in some way?
I'm trying to make a game where it's similar to the example shown with the houses on the hills (where you can go to each location by clicking on them), but I wanted to see if it was possible to show the screen while making everything in it inactive whilst text appears.
I'm trying to make it so that you can click on characters to talk to them, so I would like it if the player wouldn't be able to click on another location or character in the middle of a conversation.
I'm also curious if there is a way to make the parallax "pause", or at least stop moving, whenever these conversations happen, and then make it movable once the conversation is over, but that's more of an aesthetic choice so I'm not too worried about that.
Thanks in advance!
Yeah you can have a condition set up to toggle properties like mousewheel or edgescroll to False! (which would mean the viewport won't move). You can also set entire screens to insensitive with the screen property sensitive, or block input in other ways such as by putting a big NullAction button over things to absorb input first.
Got it to work eventually, thanks!
Would you by chance also happen to know if there is a way to keep the screen around after jumping? I'm trying to make it to where when you click on a character, it jumps to a label I have where the character's sprite and dialog is shown, and then once he's done talking it jumps back to the paralax screen. But currently it just makes the screen go away and the background turns black.
Is there a way to make it jump while keeping the screen around in the background? Or is there simply a better way of doing this altogether?
Thanks again in advance!
You'd need to re-show the screen with `show screen whatsit` generally - if you call the screen and then jump to a label, that ends the interaction with the screen and hides it automatically. You might also consider showing the screen on the master layer if needed so you can show sprites in front of it etc.
I see, the problem I was having with that was that when re-showing a screen, it repositioned it to it's default origin, so I was hoping for something that would just show the label's contents within the screen.
HOWEVER, I ended up using "renpy.call_in_new_context" in a function and called that function within the imagebutton and it did pretty much exactly what I wanted. I did still end up putting it all on the master layer like you said, just in case.
Thanks again, you've been a big help!