Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Zoom Viewport for Ren'Py

Use the mousewheel or pinch gesture to zoom in and out of a viewport. · By Feniks

Need Support? Post here! Sticky

A topic by Feniks created Jul 07, 2024 Views: 357 Replies: 15
Viewing posts 1 to 5
Developer

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.

Wondering if this is compatible with Parallax Viewport?

I’m making an in-game camera (currently with edgescrolling, no zooming capability) so this comes just right in time!

Developer

Hello! The zoom viewport and parallax viewport can coexist in the same project with no issues, but their functionalities can't quite be combined - if you nest them then I believe one viewport is prioritized for the input. It's not a bad idea though, so I'll put that in my back pocket to potentially combine! I might need to adjust the behavior of the parallax so the zoom looks nice too, since it's currently designed just for one depth level. I will reply to this comment if I do make a combination one!

I see, thank you very much for the swift response!

Developer

Delightful news, I had a chance to smash the two viewports' code together, and with a few tweaks, it's working fantastically! I want to do some more testing yet, and I think I'll add a property or two specific to this iteration of the zoom/parallax combo, but I imagine it should be out within the week :D

That was quick :o Looking forward for the release

Hello! Have there been any updates regarding this? Is a combined zoom/parallax viewport possible with the current or release or is it not out yet? I'm really eager to see how they both work together!

Thank you for your wonderful tools and contributing so much to this community!

Developer

Hello! Thanks so much for your interest. Honestly the parallax+zoom viewport has been sitting around on my computer in an almost-completed state; I just need to finish adding some examples and make a page and screenshots for it. I appreciate the prodding so I can bump it higher on my list to just get out! I'll aim for this month so it's not just sitting around gathering dust.

Hello, sorry this question is somewhat unrelated to the tool itself. I wanted to ask how you did the flowchart showcased in the gif? I want to implement one for my own game, but can't think of an effective approach that can adapt easily to any script changes.

Thank you for all the wonderful tools by the way, I've used them for all of my games so far <3

Developer

👀👀👀 Haha you have discovered my secret tool I've been working on since early this year - I'm hoping to release it in the coming months! The flowchart tool will be paid - it's incredibly feature-rich, and I've put a lot of time and effort into making it extremely flexible, to give you a heads up. And I'm delighted to hear you've gotten use out of my tools ✨

So it’s true! I’m wondering about that. Thanks for giving the heads-up. Your tools are fantastic.

Ahhhh I'm so excited!!! I can't wait to use it, but obviously take your time with it. Thank you again!

Hi! Is there a way to add buttons to the viewport that stay the same size when zooming in/out?

Developer

Not directly, though that's something I've considered for a future update. You can, however, use the zoom_callback feature to update displayables - for example, if the provided current zoom is 2.0, then you'd know you should zoom your image by 1/2.0 = 0.5 so that it stays the same size visually. This will also likely mean you need to make sure your anchor points are set correctly so the image doesn't also look like it's wandering around the viewport. Hope that helps you get started! I'll try to remember to reply here if I do add a simpler/built-in way of having displayables update their size when the viewport is being zoomed.

(1 edit)

Hey!

What's the best way to get the zoom movement really smooth? No matter what I try it's always quite sluggish. Even the included example has exhibits this jerky motion. Many thanks in advance! :)

Developer

Hey there, feel free to use the zoom_curve or zoom_speed properties to adjust the zoom warper and speed however you like. This is more of a personal preference thing on your end, and you're welcome to modify the code to suit your needs.