Page 1 of 1

[solved] Choice Menu Background

Posted: Sun Nov 27, 2016 9:19 am
by Kaen
Hello!

How can I change the choice menu background using the new GUI?

I checked the doc but replacing the images on gui/button folder still makes them look weird since their size is not adjusted.

Previously to the new GUI I used this code to change the background, but it's not working anymore:

Code: Select all

style.menu_choice_button.background = "images/choice_idle_background.png"
style.menu_choice_button.hover_background = "images/choice_hover_background.png"
style.menu_choice_button.yminimum = 106
style.menu_choice_button.xminimum = 1139
style.menu_choice.font = "fonts/arial.ttf"

Re: Choice Menu Background

Posted: Sun Nov 27, 2016 9:34 am
by Ocelot
So, do the same, but in new GUI style language.
First, check gui.choice_button_width and gui.choice_button_height in gui.rpy. Set them to desired size, or None if you do not want to set size explicitely.

Second, find choice_button style in screens.rpy. Add additional style properties as needed (in your example xminumum)

Note that choice button text is controlled by other variables/style, but they are near those for button itself. I think, you'll manage.

Re: Choice Menu Background

Posted: Sun Nov 27, 2016 9:48 am
by Kaen
Thanks Ocelot!

I could change the background as intended but the button text is aligned to the top of the image. I tried this but it didn't change anything:

Code: Select all

define gui.choice_button_text_yalign = 0.5
Any tips?

Re: Choice Menu Background

Posted: Sun Nov 27, 2016 9:57 am
by Kaen
Nevermind!

I added it directly on the style:

Code: Select all

style choice_button_text is default:
    properties gui.button_text_properties("choice_button")
    yalign 0.5
Thank you so much for the help!