[solved] Choice Menu Background

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
User avatar
Kaen
Regular
Posts: 148
Joined: Tue Oct 16, 2012 10:49 pm
Contact:

[solved] Choice Menu Background

#1 Post by Kaen » Sun Nov 27, 2016 9:19 am

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"
Last edited by Kaen on Sun Nov 27, 2016 9:58 am, edited 1 time in total.

User avatar
Ocelot
Miko-Class Veteran
Posts: 849
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

Re: Choice Menu Background

#2 Post by Ocelot » Sun Nov 27, 2016 9:34 am

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.
< < insert Rick Cook quote here > >

User avatar
Kaen
Regular
Posts: 148
Joined: Tue Oct 16, 2012 10:49 pm
Contact:

Re: Choice Menu Background

#3 Post by Kaen » Sun Nov 27, 2016 9:48 am

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?

User avatar
Kaen
Regular
Posts: 148
Joined: Tue Oct 16, 2012 10:49 pm
Contact:

Re: Choice Menu Background

#4 Post by Kaen » Sun Nov 27, 2016 9:57 am

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!

Post Reply

Who is online

Users browsing this forum: drKlauz, Google [Bot]