I'm having a weird issue that I can't quite figure out.
In my code, I have a textbutton that's supposed to hover when I mouse over it, except it doesn't.
I'm pretty sure I've determined the cause: I have an action (one of a few) on said textbutton, SetVariable("player_choice", 0).
Now if player_choice is already at 0, the button won't hover. If I change the player_choice value before testing the button with the SetVariable info staying the same, it hovers like expected. I should also point out that regardless of whether or not the textbutton hovers, it still works. Clicking it produces the desired effects of my actions in all scenarios; it just doesn't hover if I set up the situation as previously mentioned.
Is this intended or is there a reason why this is happening that I'm unaware of? I'm not very familiar with python.
[SOLVED]Textbutton won't hover on SetVariable action
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.
[SOLVED]Textbutton won't hover on SetVariable action
Last edited by awonderL on Tue Nov 30, 2021 12:54 am, edited 1 time in total.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Textbutton won't hover on SetVariable action
If player_choice is 0, then the variable will be in the selected_hover style prefix. Chances are, the selected style prefix is being styled in a way that overrides the hover style prefix, and hence hence the button isn't changing.
If you hover the button, and then click on the name of the style next to the text, you can see where this is set.
If you hover the button, and then click on the name of the style next to the text, you can see where this is set.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Textbutton won't hover on SetVariable action
Thanks for your help, PyTom!
Your info directed me to use the SelectedIf distinction on one my actions to prevent the styling.
Your info directed me to use the SelectedIf distinction on one my actions to prevent the styling.
Who is online
Users browsing this forum: DewyNebula