Here's what I have so far:
The only reason I have about 8 duplicates of the same button is because otherwise renpy would tell me 'Grid not completely full' and wouldn't work.init python:
# Step 1. Create the gallery object.
g = Gallery()
g.background = "elvineroom.png"
g.locked_button = "commonlock.png"
g.locked_background = "commonlock.png"
# Step 2. Add buttons and images to the gallery.
# A button that contains an image that automatically unlocks.
g.button("cglukas1")
g.image("cglukas1.png")
g.unlock("cglukas1.png")
g.button("elvinevillage")
g.unlock_image ("cgelainevillage.png")
# This button has multiple images assocated with it. We use unlock_image
# so we don't have to call both .image and .unlock. We also apply a
# transform to the first image.
#g.button("dark")
#g.unlock_image("bigbeach1")
#g.transform(slowpan)
#g.unlock_image("beach1 mary")
#g.unlock_image("beach2")
#g.unlock_image("beach3")
# This button has a condition associated with it, allowing code
# to choose which images unlock.
#g.button("end1")
#g.condition("persistent.unlock_1")
#g.image("transfer")
#g.image("moonpic")
#g.image("girlpic")
#g.image("nogirlpic")
#g.image("bad_ending")
#g.button("end2")
#g.condition("persistent.unlock_2")
#g.image("library")
#g.image("beach1 nomoon")
#g.image("bad_ending")
# The last image in this button has an condition associated with it,
# so it will only unlock if the user gets both endings.
#g.button("end3")
#g.condition("persistent.unlock_3")
#g.image("littlemary2")
#g.image("littlemary")
#g.image("good_ending")
#g.condition("persistent.unlock_3 and persistent.unlock_4")
#g.button("end4")
#g.condition("persistent.unlock_4")
#g.image("hospital1")
#g.image("hospital2")
#g.image("hospital3")
#g.image("heaven")
#g.image("white")
#g.image("good_ending")
#g.condition("persistent.unlock_3 and persistent.unlock_4")
# The final two buttons contain images that show multiple pictures
# at the same time. This can be used to compose character art onto
# a background.
#g.button("dawn mary")
#g.unlock_image("dawn1", "mary dawn wistful")
#g.unlock_image("dawn1", "mary dawn smiling")
#g.unlock_image("dawn1", "mary dawn vhappy")
#g.button("dark mary")
#g.unlock_image("beach2", "mary dark wistful")
#g.unlock_image("beach2", "mary dark smiling")
#g.unlock_image("beach2", "mary dark vhappy")
# The transition used when switching images.
#g.transition = dissolve
# Step 3. The gallery screen we use.
screen gallery:
# Ensure this replaces the main menu.
tag menu
# The background.
add "elvineroom.png"
# A grid of buttons.
grid 3 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("cglukas1", "lukaslock.png", xalign=0.5, yalign=0.5)
add g.make_button("elvinevillage", "lukaslock.png", xalign=0.5, yalign=0.5)
add g.make_button("cglukas1", "cglukas1.png", xalign=0.5, yalign=0.5)
add g.make_button("cglukas1", "cglukas1.png", xalign=0.5, yalign=0.5)
add g.make_button("cglukas1", "cglukas1.png", xalign=0.5, yalign=0.5)
add g.make_button("cglukas1", "cglukas1.png", xalign=0.5, yalign=0.5)
add g.make_button("cglukas1", "cglukas1.png", xalign=0.5, yalign=0.5)
add g.make_button("cglukas1", "cglukas1.png", xalign=0.5, yalign=0.5)
#add g.make_button("dawn", "gal-dawn.png", xalign=0.5, yalign=0.5)
#add g.make_button("end1", "gal-end1.png", xalign=0.5, yalign=0.5)
#add g.make_button("end2", "gal-end2.png", xalign=0.5, yalign=0.5)
#add g.make_button("end3", "gal-end3.png", xalign=0.5, yalign=0.5)
#add g.make_button("end4", "gal-end4.png", xalign=0.5, yalign=0.5)
#add g.make_button("dark mary", "gal-dark_mary.png", xalign=0.5, yalign=0.5)
#add g.make_button("dawn mary", "gal-dawn_mary.png", xalign=0.5, yalign=0.5)
# The screen is responsible for returning to the main menu. It could also
# navigate to other gallery screens.
textbutton "Return" action Return() xalign 0.5 yalign 0.5
The problem is: Is that the buttons show up but they never unlock. From what I can understand, since I didn't have any g.condition statement they should show up right away. Ive played through the game to see if they were unlock after Ive seen them in game but they are still locked.
I also have another question.
In this:
g.button("cglukas1")
g.image("cglukas1.png")
g.unlock("cglukas1.png")
the g.image is the bigger image (The 800x600 image in my case) and the "lukaslock.png" in this:
add g.make_button("cglukas1", "lukaslock.png", xalign=0.5, yalign=0.5)
is the thumbnail, correct?
(I don't know if this will help but in my example the 'Cglukas1.png' is a big picture (800x600) and the Lukaslock.png and Commonlock.png are both small pictures meant to be thumbnails)
I've been struggling with this all day and I honestly don't know if I made a silly mistake or if I am using outdated code or what. This is literally the last thing preventing me from finishing my visual novel :\ Any sort of help is absolutely welcome!