How can I make hover textbutton stay hovered until another textbutton is hovered over?
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.
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.
How can I make hover textbutton stay hovered until another textbutton is hovered over?
Hi there.
I'm trying to make a text button's background stay selected when hovered, and only change when another text button is hovered over, making it the new selected button. This should continue as the user moves between text buttons.
Here's an example so it's better to understand what i'm trying to achieve. https://i.imgur.com/Qwer6V5.gif
I managed to get the background on the textbutton using "style", any ideas how to achieve above mentioned effect?
I'm trying to make a text button's background stay selected when hovered, and only change when another text button is hovered over, making it the new selected button. This should continue as the user moves between text buttons.
Here's an example so it's better to understand what i'm trying to achieve. https://i.imgur.com/Qwer6V5.gif
I managed to get the background on the textbutton using "style", any ideas how to achieve above mentioned effect?
Re: How can I make hover textbutton stay hovered until another textbutton is hovered over?
Code: Select all
screen hover_button():
zorder 10
imagebutton:
idle "button_idle.png"
hover "button_hover.png"
selected_idle "button_selected.png"
action Jump("label_name")
label start:
show screen hover_button
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Re: How can I make hover textbutton stay hovered until another textbutton is hovered over?
I'm sorry but this is not at all what i'm looking for.Andredron wrote: ↑Mon May 27, 2024 1:44 amCode: Select all
screen hover_button(): zorder 10 imagebutton: idle "button_idle.png" hover "button_hover.png" selected_idle "button_selected.png" action Jump("label_name") label start: show screen hover_button
- m_from_space
- Eileen-Class Veteran
- Posts: 1060
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: How can I make hover textbutton stay hovered until another textbutton is hovered over?
I mean I would just use a screen variable that remembers which button is currently prominent.
Code: Select all
screen myscreen():
default active = None
vbox:
textbutton "Play":
action NullAction()
hovered SetScreenVariable("active", 0)
if active == 0:
background Solid("#f0f5")
textbutton "Options":
action NullAction()
hovered SetScreenVariable("active", 1)
if active == 1:
background Solid("#f0f5")
Re: How can I make hover textbutton stay hovered until another textbutton is hovered over?
Thanks this seems to work great, is there a way i could make one of the buttons already "active" with the background without having to hover over it, but still hide, when hovered over a different button?m_from_space wrote: ↑Mon May 27, 2024 5:42 amI mean I would just use a screen variable that remembers which button is currently prominent.
Code: Select all
screen myscreen(): default active = None vbox: textbutton "Play": action NullAction() hovered SetScreenVariable("active", 0) if active == 0: background Solid("#f0f5") textbutton "Options": action NullAction() hovered SetScreenVariable("active", 1) if active == 1: background Solid("#f0f5")
- m_from_space
- Eileen-Class Veteran
- Posts: 1060
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: How can I make hover textbutton stay hovered until another textbutton is hovered over?
Yeah, just set the screen variable to this button's "id" so to speak when initializing it.
Code: Select all
screen myscreen():
# make the Play button hovered by default
default active = 0
...
Re: How can I make hover textbutton stay hovered until another textbutton is hovered over?
Worked great, appreciate your help man! All the best!m_from_space wrote: ↑Mon May 27, 2024 1:01 pmYeah, just set the screen variable to this button's "id" so to speak when initializing it.
Code: Select all
screen myscreen(): # make the Play button hovered by default default active = 0 ...
Who is online
Users browsing this forum: LemonaBittera, Ocelot