[SOLVED] To access to the gallery page from the menu AND from the game

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
liagel
Regular
Posts: 28
Joined: Thu Jan 10, 2019 5:13 pm
Contact:

[SOLVED] To access to the gallery page from the menu AND from the game

#1 Post by liagel » Fri Apr 19, 2019 7:48 am

Hello everyone,

I have a gallery page that you can access from the main menu.

So I have this link to go to the gallery page in screen.rpy:

Code: Select all

... action ShowMenu("gallery")]
And on the gallery (gallery.rpy), I have this button to go back:

Code: Select all

imagebutton "gallery/back.png" action Return() xalign 0.5 yalign 0
And everything goes well... from the main menu.

Now I have a map ingame (map.rpy), and I would like that players can access the gallery directly from the map.

So, I have set the link to open the gallery:

Code: Select all

action Show("gallery")
But the problem is that the Back button on the gallery page (action Return()) goes to the main menu instead of going back on the map...

So, I think I need to replace the back button but as it is the same gallery page, how can i do to have a link go back, as well on the map or on the main menu?

I don't know if I'm perfectly clear and my English is not that good.

Thank you for your help!
Last edited by liagel on Fri Apr 19, 2019 11:43 am, edited 1 time in total.

User avatar
Matalla
Veteran
Posts: 202
Joined: Wed Mar 06, 2019 6:22 pm
Completed: The Lost Smile
itch: matalla-interactive
Location: Spain
Contact:

Re: To access to the gallery page from the menu AND from the game

#2 Post by Matalla » Fri Apr 19, 2019 10:38 am

The map is a screen, a label or what? Anyway, something like this would probably work:

Code: Select all

    if main_menu:
        imagebutton "gallery/back.png" action Return() xalign 0.5 yalign 0
    else:
        imagebutton "gallery/back.png" action Hide("gallery") xalign 0.5 yalign 0
Comunidad Ren'Py en español (Discord)
Honest Critique

liagel
Regular
Posts: 28
Joined: Thu Jan 10, 2019 5:13 pm
Contact:

Re: To access to the gallery page from the menu AND from the game

#3 Post by liagel » Fri Apr 19, 2019 11:43 am

Erf, obviously...
Sometime, you're thinking on a problem for hours, and you miss the simple solution.
Thank you very much Matalla, it works fine.
I just have a black screen when hiding the gallery on the map, but I will figure that.
And yes, the map is a screen.

Thank you ! :)

Post Reply

Who is online

Users browsing this forum: drKlauz, Google [Bot], Volta