Textbutton remains "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
Cazad0ra
Newbie
Posts: 22
Joined: Wed May 19, 2021 3:53 pm
Contact:

Textbutton remains "hovered"

#1 Post by Cazad0ra »

Hi! I'm having a little issue in an in-game screen menu I built for my game. I have a list of text buttons and function wise they work perfectly, but for some reason they remain hovered even after unhovering them and moving to another button. I could throw in some imagebuttons instead, but I rather try and understand what the issue could be :cry:

Here's a couple of buttons:

Code: Select all

vbox:
        pos(1413, 217)
        spacing 5
        frame at flashup1:
            style "interfacebutton"
            textbutton "{font=fonts/Friz Quadrata Regular.ttf}Formation{/font}":
                text_size 25
                align (0.5,0.5)
                hovered SetVariable("helptext", "Change your party configuration. Select the party slot first, then the character you want to swap from the combatant list.")
                unhovered SetVariable("helptext", "")
                if party != party1:
                    action NullAction()
                else:
                    if renpy.get_screen("partyselector"):
                        action Hide("partyselector")
                    else:
                        action Show("partyselector"), Hide("RedeemCode"), Hide("CharacterEquipement"), Hide("CombatItems"), Hide("DateInfo"), SetVariable("selected_potion", 0), Hide("character_attributes"), SetVariable("selected_date", None)
        frame at flashup2:
            style "interfacebutton"

            textbutton "{font=fonts/Friz Quadrata Regular.ttf}Combat Items{/font}":
                text_size 25
                align (0.5,0.5)
                hovered SetVariable("helptext", "Change the available items during combat. Select the item slot first, then the item you want to swap from the battle inventory.")
                unhovered SetVariable("helptext", "")
                if renpy.get_screen("CombatItems"):
                    action Hide("CombatItems"), SetVariable("selected_potion", 0)
                else:
                    action Hide("partyselector"), Hide("RedeemCode"), Hide("CharacterEquipement"), Hide("DateInfo"), Show("CombatItems"), Hide("character_attributes"), SetVariable("selected_date", None)

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Textbutton remains "hovered"

#2 Post by rayminator »

what do you have in style "interfacebutton"?

but I think it this though helptext you have it in both hovered & unhovered it might be conflicting with each other

Cazad0ra
Newbie
Posts: 22
Joined: Wed May 19, 2021 3:53 pm
Contact:

Re: Textbutton remains "hovered"

#3 Post by Cazad0ra »

Ahh I forgot to put that, mostly a frame using an image

Code: Select all

style interfacebutton:
    background "interface/user/button_frame.png"
    maximum (443,87)
    minimum (443,87)
Yeah, that's what I was fearing... if it's the case, then I better work this with image buttons

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Textbutton remains "hovered"

#4 Post by Ocelot »

Are you trying to reimplement tooltips by any chance?

Does anything covers the button or hides screen where button is, or moves button itself, when pointer is over the button?
< < insert Rick Cook quote here > >

Cazad0ra
Newbie
Posts: 22
Joined: Wed May 19, 2021 3:53 pm
Contact:

Re: Textbutton remains "hovered"

#5 Post by Cazad0ra »

The base screen where the menu buttons are is always displayed, and some of the buttons show new screens indeed, but none should go over the buttons. I understand it can still affect them? :o

Also, updated the code to use a tooltip, quite cleaner >.<

Post Reply

Who is online

Users browsing this forum: Google [Bot], piinkpuddiin