I first tried with a boolean but not working, then I copy pasted codes that worked with some people but not for me. And yet, the only thing that changes are just the number of pictures.
I keep trying, the different solutions proposed to me via the Renpy Discord didn't work either.
I tested with the delete persistent but nothing changed.
Here's my code.
Code: Select all
#Galleries:
init python:
#Galleries settings - start
#list the CG gallery images here:
gallery_cg_items = ["bg sc01", "bg sc02", "bg sc03", "bg sc04", "bg sc05", "bg sc06", "bg sc07", "bg sc08", "bg sc09", "bg sc10", "bg sc11", "bg sc12", "bg sc13", "bg sc14", "bg sc15", "bg sc16", "bg sc17", "bg sc18", "bg sc19", "bg sc20", "bg sc21", "bg sc22", "bg sc23", "bg sc24", "bg sc25"]
#how many rows and columns in the gallery screens?
gal_rows = 3
gal_cols = 3
#thumbnail size in pixels:
thumbnail_x = 192
thumbnail_y = 108
#the setting above (267x150) will work well with 16:9 screen ratio. Make sure to adjust it, if your are using 4:3 or something else.
#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:
renpy.image ("bg sc01 butt", im.Scale("bg_encounter1.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc02 butt", im.Scale("bg_encounter2.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc03 butt", im.Scale("bg_Dragon.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc04 butt", im.Scale("bg_Fight3.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc05 butt", im.Scale("bg_Fight4.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc06 butt", im.Scale("bg_What.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc07 butt", im.Scale("bg_backstory1.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc08 butt", im.Scale("bg_backstory2.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc09 butt", im.Scale("bg_realstory1.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc10 butt", im.Scale("bg_realstory2.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc11 butt", im.Scale("bg_realstory3.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc12 butt", im.Scale("bg_realstory4.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc13 butt", im.Scale("bg_realstory5.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc14 butt", im.Scale("bg_realstory6.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc15 butt", im.Scale("bg_First.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc16 butt", im.Scale("bg_smallchild.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc17 butt", im.Scale("bg_refug.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc18 butt", im.Scale("bg_antihero.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc19 butt", im.Scale("bg_alliance.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc20 butt", im.Scale("bg_finalbattle.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc21 butt", im.Scale("bg_finale.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc22 butt", im.Scale("bg_end.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc23 butt", im.Scale("bg_castle.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc24 butt", im.Scale("bg_throneroom.jpg", thumbnail_x, thumbnail_y))
renpy.image ("bg sc25 butt", im.Scale("bg_balcony.jpg", thumbnail_x, thumbnail_y))
screen cg_gallery:
tag menu
use game_menu(_("Image Gallery"), scroll="viewport"):
hbox:
grid gal_cols gal_rows:
spacing 35
$ 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("lock.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=0)
for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
null
frame:
xpos 35
ypos 455
if len(gallery_cg_items)>gal_cells:
textbutton _("Next Page") action [SetVariable('cg_page', next_cg_page), ShowMenu("cg_gallery")]
I know when I put # in front of this line g_cg.unlock(gal_item), the gallery is unlocked forever.
I need help, I'm at wit's end.
Please help me