Searched for a few days and, surprisingly, cannot find an answer to this one. So here goes:
Using leon's most excellent code, I've created a Gallery.
My screen size is 1024 x 768.
Most of the 30-odd images in said Gallery are 1024 x 768.
Several, however, are oversize; in the game, I use "crop" to pan and zoom about.
These oversizes include: 1424 x 1536 and 1024 x 1536.
Is there way that, once the player clicks on the button to see the image in the Gallery, that image is either resized or it triggers the same "crop" commands that I have in the story?
Thanks in advance!
Resizing Gallery Images
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.
- Clayton Barnett
- Regular
- Posts: 80
- Joined: Wed Sep 12, 2012 12:20 pm
- Projects: OKaverse VNs
- Organization: 3-AR Studios LLC
- Location: Ohio
- Contact:
-
- Veteran
- Posts: 479
- Joined: Tue Jun 05, 2012 2:01 am
- Contact:
Re: Resizing Gallery Images
See http://www.renpy.org/doc/html/rooms.htm ... .transform ; you just need to add a call to g.transform() after the call to g.image().
- Clayton Barnett
- Regular
- Posts: 80
- Joined: Wed Sep 12, 2012 12:20 pm
- Projects: OKaverse VNs
- Organization: 3-AR Studios LLC
- Location: Ohio
- Contact:
Re: Resizing Gallery Images
Thank you for your reply, apricotorange, however you've mistaken me for someone who knows what they're doing. When it comes to RenPy code, please rest assured of my ignorance.
What I have right now is this (showing only two reference images... no need for all 26):
"bg prologue" is sized like my screen, 1024 x 768.
"bg mnem intro" is 1024 x 1539.
Ideally what I would like is the same code this character gets in the game as an introduction...
but is that's not possible, then just rescaling the image so it fits into the 1024 x768 window would be fine.
Again, I apologize for my ignorance. RenPy is an amazingly powerful tool. I'm a bit in the position of a 19th Century tinkerer given a 21st Century breeder reactor to play with: it could end... poorly.
Thanks again!
What I have right now is this (showing only two reference images... no need for all 26):
Code: Select all
#Galleries:
init python:
#Galleries settings - start
#list the CG gallery images here:
gallery_cg_items = ["bg prologue", "bg mnem intro"]
gal_rows = 3
gal_cols = 3
thumbnail_x = 228
thumbnail_y = 175
#Galleries settings - end
gal_cells = gal_rows * gal_cols
g_cg = Gallery()
for gal_item in gallery_cg_items:
g_cg.button(gal_item + " butt")
g_cg.image(gal_item)
g_cg.unlock(gal_item)
g_cg.transition = fade
cg_page=0
init +1 python:
#Here we create the thumbnails. We create a grayscale thumbnail image for BGs, but we use a special "locked" image for CGs to prevent spoilers.
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
screen cg_gallery:
tag menu
use navigation
frame background None xpos 10:
grid gal_rows gal_cols:
ypos 10
$ i = 0
$ next_cg_page = cg_page + 1
if next_cg_page > int(len(gallery_cg_items)/gal_cells):
$ next_cg_page = 0
for gal_item in gallery_cg_items:
$ i += 1
if i <= (cg_page+1)*gal_cells and i>cg_page*gal_cells:
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
null
frame:
yalign 0.97
vbox:
if len(gallery_cg_items)>gal_cells:
textbutton _("Next Page") action [SetVariable('cg_page', next_cg_page), ShowMenu("cg_gallery")]
"bg mnem intro" is 1024 x 1539.
Ideally what I would like is the same code this character gets in the game as an introduction...
Code: Select all
scene bg mnem intro:
crop (200, 1000, 600, 900)
size (1024, 1539)
linear 1.0 crop (200, 1000, 600, 900)
linear 5.0 crop (0, 0, 1024, 1539)
with fade
Again, I apologize for my ignorance. RenPy is an amazingly powerful tool. I'm a bit in the position of a 19th Century tinkerer given a 21st Century breeder reactor to play with: it could end... poorly.
Thanks again!
Who is online
Users browsing this forum: Ahrefs [Bot]