Zoom-in button for image gallery

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
facesit-inc
Newbie
Posts: 23
Joined: Wed Dec 09, 2020 4:04 pm
Contact:

Zoom-in button for image gallery

#1 Post by facesit-inc »

Hello,

I'm having a hard time making a button, which would zoom-in the current gallery item. I tested that the button appears on the screen correctly:

vbox xalign 0.98 yalign 0.1:
imagebutton:
idle "gui/zoom_idle.png"
hover "gui/zoom_hover.png"
action NullAction()

but honestly I simply don't understand, which action should do the trick. I've already tried the zoom (as in ATL), but I get the error that this parameter uses the screen language. Studying the screen language, I found the im.Scale parameter, but it seems I can't use it correctly as well.

Which action should be placed here?

P.S. By the way, I'm placing this button near the grid and return button on the gallery screen.

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: Zoom-in button for image gallery

#2 Post by emz911 »

There are several ways to do it. If you want to use ATL transform to an image in a screen, do:

Code: Select all

add “image_name.png”:
     at TransformName
You can give this a condition (if) so it can be shown and hidden by button actions.
Another way is to show a different screen containing the zoomed in image, or you can also call a label on action and return to your screen when done.
The best method depends on what you exactly want to achieve~

facesit-inc
Newbie
Posts: 23
Joined: Wed Dec 09, 2020 4:04 pm
Contact:

Re: Zoom-in button for image gallery

#3 Post by facesit-inc »

emz911 wrote: Fri Apr 30, 2021 12:56 am There are several ways to do it. If you want to use ATL transform to an image in a screen, do:

Code: Select all

add “image_name.png”:
     at TransformName
You can give this a condition (if) so it can be shown and hidden by button actions.
Another way is to show a different screen containing the zoomed in image, or you can also call a label on action and return to your screen when done.
The best method depends on what you exactly want to achieve~

Thank you. It's more complex than I've thought, but doable.

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: Zoom-in button for image gallery

#4 Post by emz911 »

Came across this thread and found that there is an one step action you can do to show images with transform on screen:
viewtopic.php?t=45661

Code: Select all

Function(renpy.show, "my_image", at_list=[my_transform])

facesit-inc
Newbie
Posts: 23
Joined: Wed Dec 09, 2020 4:04 pm
Contact:

Re: Zoom-in button for image gallery

#5 Post by facesit-inc »

emz911 wrote: Wed May 05, 2021 1:21 pm Came across this thread and found that there is an one step action you can do to show images with transform on screen:
viewtopic.php?t=45661

Code: Select all

Function(renpy.show, "my_image", at_list=[my_transform])
Sorry for the late answer, did not see that you responded again. I defined the new transform (galleryzoom) and used a test image. It doesn't seem to do anything, I don't even get any error, it just doesn't work.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]