Greetings to all!
I want to find out if there is any way to change the size of images in the gallery through the engine itself, using code. I understand that their size can be changed via Photoshop, but then they will decrease both on the PC version of the game and on the mobile. I would like to change their size exclusively for mobile devices, using code. I am not a programmer myself, so I cannot implement this feature.
I hope for your help and thank everyone who responds.
Resizing images in the gallery via the engine
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.
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.
- m_from_space
- Veteran
- Posts: 302
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Resizing images in the gallery via the engine
Depending on what you want, you can just easily use a transform like zoom or just set xsize and ysize.
Another easy way would be to use the Frame() function, since it automatically resizes the containing image to the available area.
https://www.renpy.org/doc/html/displayables.html#Frame
Code: Select all
transform zm(z=0.5):
zoom z
screen mygallery:
vbox:
add "myimage" at zm
add "anotherimage" xsize 200 ysize 200
https://www.renpy.org/doc/html/displayables.html#Frame
- Pavel8694
- Newbie
- Posts: 4
- Joined: Sat Aug 06, 2022 11:51 am
- Completed: Gachimuchi: Become Dungeon Master, The Casino Incident.
- Organization: Meme Corporation
- itch: meme-corporation
- Contact:
Re: Resizing images in the gallery via the engine
Thank you so much for your help! I decided to use the method with xsize and ysize for now:m_from_space wrote: ↑Sun Aug 07, 2022 2:22 amDepending on what you want, you can just easily use a transform like zoom or just set xsize and ysize.
Another easy way would be to use the Frame() function, since it automatically resizes the containing image to the available area.Code: Select all
transform zm(z=0.5): zoom z screen mygallery: vbox: add "myimage" at zm add "anotherimage" xsize 200 ysize 200
https://www.renpy.org/doc/html/displayables.html#Frame
Code: Select all
if renpy.variant("mobile"):
add gl.make_button("horrorending", "horrorendinggallerypreview", xalign=0.5, yalign=3.0, hover_border="images/other/frame.png") xsize 430 ysize 252
add gl.make_button("goodending", "theendgallerypreview", xalign=0.5, yalign=3.0, hover_border="images/other/frame.png") xsize 430 ysize 252
add gl.make_button("neutralending", "neutralendinggallerypreview", xalign=0.5, yalign=3.0, hover_border="images/other/frame.png") xsize 430 ysize 252
add gl.make_button("neutralending2", "neutralending2gallerypreview", xalign=0.5, yalign=6.5, hover_border="images/other/frame.png") xsize 430 ysize 252
add gl.make_button("poster", "postergallerypreview", xalign=0.5, yalign=6.5, hover_border="images/other/frame.png") xsize 430 ysize 252
add gl.make_button("bonus", "bonusgallerypreview", xalign=0.5, yalign=6.5, hover_border="images/other/frame.png") xsize 430 ysize 252
nullOnce again, thank you for your help. Have a nice day!
Who is online
Users browsing this forum: mold.FF