Do I need to crop imagebuttons? (solved)

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
scarecorw-76
Newbie
Posts: 8
Joined: Mon Nov 08, 2021 9:32 pm
Projects: Hussies of Pleasureville
IRC Nick: Scarecrow-76
itch: Scarecrow-76
Contact:

Do I need to crop imagebuttons? (solved)

#1 Post by scarecorw-76 » Wed Oct 26, 2022 12:36 pm

Quick noob question. Can I just keep my png imagebuttons at 1920 x 1080 to save time? Or is this problematic with overlaying other buttons, even with transparent backgrounds? Is it to save on file size? Thanks. Just wondering, so I didnt have to deal with finding the correct x/y pos.
Last edited by scarecorw-76 on Wed Oct 26, 2022 8:33 pm, edited 1 time in total.

User avatar
Tess
Newbie
Posts: 23
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: Do I need to crop imagebuttons?

#2 Post by Tess » Wed Oct 26, 2022 2:32 pm

If the button itself is 1920X1080, you can give the imagebutton an xysize to scale it down in the game. It takes a tuple with integers for absolute number of pixels or floats between 0.0 and 1.0 for size relative to the screen (for example: xsize (0.3,0.5) sets the button to 30% of the screen's width and 50% of the screen's height).

If the button is already the size it should be just with a lot of transparent area around it, I think it's ok as long as your default game resolution is set to 1920X1080 and the button is in same place it needs to be on the screen in the image. I'm 95% sure Ren'Py automatically gets rid of transparency surrounding buttons when it loads them into memory, so I don't think there will be any negative side effects.

scarecorw-76
Newbie
Posts: 8
Joined: Mon Nov 08, 2021 9:32 pm
Projects: Hussies of Pleasureville
IRC Nick: Scarecrow-76
itch: Scarecrow-76
Contact:

Re: Do I need to crop imagebuttons?

#3 Post by scarecorw-76 » Wed Oct 26, 2022 8:32 pm

Yeah, the button is the correct size. What I was trying to do was a gamemap with several locations, and you're correct. I managed to put twenty imagebuttons all 1920 x 1080 with transparency on top of each other, and it works perfectly. Saved me a lot of time and hassle not having to crop and figure out the correct x/ypos.

Post Reply

Who is online

Users browsing this forum: Google [Bot]