Imagebutton to show an image

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
User avatar
richycapy
Regular
Posts: 51
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Imagebutton to show an image

#1 Post by richycapy » Sat Oct 26, 2019 3:52 pm

Hi

Im trying to create a Gallery, but since it combined between images and videos, right now Im trying to create a button that calls the lightbox to show the image...
The idea is to use the same code for all images, just changing the name of the file, this is what I have:

Code: Select all

screen verfoto(pic=False):
    modal True zorder 10
    add 'images/splash/gi/'+pic+'.png'
    button background None action Hide('verfoto')
    
imagebutton auto "images/gui/galeria/thumbs/chloe-imagen-01_%s.png" action Show("verfoto('chloe-imagen-01')")
But it gives me an error since I cant use the action Show while trying calling the name of the file

Can someone help me with this? :D

Thanks a lot!

=============
EDIT:
Found the solution, here is for anybody else looking for something like this:

Code: Select all

imagebutton auto "images/gui/galeria/thumbs/chloe-imagen-01_%s.png" action Show("verfoto", dissolve, "chloe-imagen-01")

Post Reply

Who is online

Users browsing this forum: Bing [Bot]