[Solved] hover_background None doesn't work in style navigation_button: variant('small')

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: 322
Joined: Wed Aug 22, 2018 1:22 am
Contact:

[Solved] hover_background None doesn't work in style navigation_button: variant('small')

#1 Post by henvu50 » Sat Aug 21, 2021 2:13 pm

EDIT: [Solved] It's because the styles were in different rpy files. I split up screens.rpy into multiple sub rpy files to organize, but that was causing the background to not get set in the variant small version. As soon as I copied the style navigation button variant small to the same rpy file that holds style navigation button, it worked.

On mobile, the hover_background wont' set to None, but xsize gets set to 800.

Code: Select all

style navigation_button:
    variant "small"
    xsize 800  #this works
    hover_background None #this doesn't work for some reason

style navigation_button:
    size_group 'navigation'
    properties gui.button_properties('navigation_button')
    hover_background Transform(someButton, xalign=0.5, yalign=0.5)
I wonder if I found a bug, maybe? Maybe I'm doing something wrong? I just need to clear the hover_background in the mobile small variant.

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

Re: [Solved] hover_background None doesn't work in style navigation_button: variant('small')

#2 Post by Ocelot » Sat Aug 21, 2021 2:56 pm

I do not really remember how variants work, but I suppose that property without variants sets that property for all variants.

If general style definition would be processed after "small" style definition, it would overwrite it.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot], span4ev