Page 1 of 1

Do I need to crop imagebuttons? (solved)

Posted: Wed Oct 26, 2022 12:36 pm
by scarecorw-76
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.

Re: Do I need to crop imagebuttons?

Posted: Wed Oct 26, 2022 2:32 pm
by Tess
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.

Re: Do I need to crop imagebuttons?

Posted: Wed Oct 26, 2022 8:32 pm
by scarecorw-76
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.