[Solved] Can a textbutton selected state be set to true if hovered?

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

[Solved] Can a textbutton selected state be set to true if hovered?

#1 Post by henvu50 »

I want to set a textbutton to selected = true if it's hovered, is this possible?

something like this:

Code: Select all

  textbutton:
      selected trueIf(self.hovered)
      # OR
      hover self.selected = True
Last edited by henvu50 on Mon Jun 21, 2021 10:06 pm, edited 1 time in total.

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: Can a textbutton selected state be set to true if hovered?

#2 Post by emz911 »

Code: Select all

hovered SetVariable("self.selected", True)

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: Can a textbutton selected state be set to true if hovered?

#3 Post by henvu50 »

emz911 wrote: Mon Jun 21, 2021 9:34 pm

Code: Select all

hovered SetVariable("self.selected", True)
That's so useful, thanks.

Post Reply

Who is online

Users browsing this forum: No registered users