Page 1 of 1

Zoom-in button for image gallery

Posted: Wed Apr 21, 2021 6:20 pm
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.

Re: Zoom-in button for image gallery

Posted: Fri Apr 30, 2021 12:56 am
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~

Re: Zoom-in button for image gallery

Posted: Sat May 01, 2021 9:26 am
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.

Re: Zoom-in button for image gallery

Posted: Wed May 05, 2021 1:21 pm
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])

Re: Zoom-in button for image gallery

Posted: Sat May 15, 2021 9:53 am
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.