Textbutton remains clicked even after I move to a new screen in main menu

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
kuuui
Newbie
Posts: 3
Joined: Mon Jan 07, 2019 1:04 am
Contact:

Textbutton remains clicked even after I move to a new screen in main menu

#1 Post by kuuui »

Hello, I'm new to renpy and I'm trying to test out various things.
I'm trying to make it such that in the main menu when I hover over the textbuttons, an image would show up at the side. I'm trying to make it so that the image would show only in the main menu screen, and not in the other screens (such as load, preference, etc.)

I managed to make this work using a variable to show the image:

Code: Select all

textbutton _("Load") action ShowMenu("load"), SetVariable("show_button", False)
However my textbuttons start looking funny when I do this. Usually they look different when they're selected, indicating what screen I am in (they become white instead of grey). But now when I click on any one of the buttons, all of them turn white, not only the one I am selecting.

I'm just wondering how I can fix the problem of the textbuttons (or if there's a better way to show the image without using variables because I'm a noob and my script is kind of inelegant). Thank you!

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Textbutton remains clicked even after I move to a new screen in main menu

#2 Post by Kia »

you should be able to use selectedIf to fix the problem
https://www.renpy.org/doc/html/screen_a ... SelectedIf


Post Reply

Who is online

Users browsing this forum: Galo223344, Google [Bot]