Zoom in/out on scrolling frame

Hello everyone. I’m planning to make a block edit game like scratch, and scratch has a zooming in/out function on the coding space. Is that possible to do in roblox?

(my current setup, scrolling frame, no zoom scripts are in)

what I want to make
image
(how should appear when zoomed out)

If you need any further infromation , just ask me

1 Like

I’ve seen you around the forum, and you seem like a pretty cool guy. I know how it feels to get a post ignored, so I feel for you not getting a response for five days. Hopefully, you found a solution by now.

But if you haven’t, I’ve had a problem similar to this, and I found a pretty simple (but kind of hacky) workaround to creating the illusion of zoom: parenting the contents of the ScrollFrame to a giant, invisible (regular) frame and then binding the size of said invisible frame to some sort of user input. ScrollFrames has a property called AutomaticCanvasSize, so if you switch that from None to XY, the scrolling size will adapt to the size of the frame. And batta bing, batta boom, you got yourself a zooming system! The only caveat to this is that any content inside of the scrollable frame (so the blocks in your case) have to be sized using Scale, NOT Offset! Otherwise, the content won’t scale with the invisible frame, and everything will break. You could apply that to make it so there’s always a minimum zoom, but I’d rather do it through code than through offsets.

If you want to bind something like a scroll wheel to this without moving Roblox’s cameras (like me), then there’s another Dev thread that tells you how to disable camera zoom.

Hope this helps :slight_smile:

2 Likes

alright, thank you a lot! I now understand that the actual problem is that I used offset and not scales. I’ll try to convert the blocks to a scale size. I’ll try this when I can!