make_button() Function resizing image.

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
cowfish13
Newbie
Posts: 23
Joined: Mon May 26, 2014 7:05 am
Contact:

make_button() Function resizing image.

#1 Post by cowfish13 »

The make_button function for the gallery menus is pretty easy to understand based on the guideline:

Code: Select all

make_button(name, unlocked, locked=None, hover_border=None, idle_border=None, **properties)
Based on it, I wanted to make a button while also downsizing the image the button will use:

Code: Select all

add g.make_button("dawn", "image.png", xalign=0.5, yalign=0.5, xsize=30, ysize=30)
However, I found xsize and ysize does not affect the button size. Am I doing things wrong? Am I actually downsizing the button itself and not the image?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: make_button() Function resizing image.

#2 Post by PyTom »

You'd haver to do that separately:

Code: Select all

add g.make_button("dawn", Transform("image.png", size=(30, 30), xalign=0.5, yalign=0.5)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Tony_Tan