This is the code for it:
Code: Select all
init python:
# Step 1. Create the gallery object.
g = Gallery()
# Step 2. Add buttons and images to the gallery.
g.locked_background = "gallery.png"
g.locked_button = "commonlock.png"
g.hover_border = None
g.idle_border = None
# A button that contains an image that automatically unlocks.
g.button("cgcarryunlock")
g.image("cgcarry")
g.unlock("cgcarry")
g.button("cgcarry")
g.unlock_image ("cgcarry")
g.button("cg1unlock")
g.image("cg1")
g.unlock("cg1")
g.button("cg1")
g.unlock_image ("cg1")
g.button("cg2unlock")
g.image("cg2")
g.unlock("cg2")
g.button("cg2")
g.unlock_image ("cg2")
g.button("cgprotectunlock")
g.image("cgprotect")
g.unlock("cgprotect")
g.button("cgprotect")
g.unlock_image ("cgprotect")
g.button("cgfightunlock")
g.image("cgfight")
g.unlock("cgfight")
g.button("cgfight")
g.unlock_image ("cgfight")
g.button("cg3unlock")
g.image("cg3")
g.unlock("cg3")
g.button("cg3")
g.unlock_image ("cg3")
# Step 3. The gallery screen we use.
screen gallery:
# Ensure this replaces the main menu.
tag menu
imagemap:
ground "gallery.png"
idle "gallery.png"
hover "galleryhover.png"
cache False
hotspot (281,53,68,26) action ShowMenu("save")
hotspot (360,53,68,26) action ShowMenu("load")
hotspot (455,53,104,26) action ShowMenu("preferences")
hotspot (575,53,76,26) action ShowMenu ("extra")
hotspot (667,53,68,26) action Help()
hotspot (750,53,68,26) action Quit(confirm=True)
hotspot (384,553,29,28) action ShowMenu ("gallery")
hotspot (419,553,29,28) action ShowMenu ("gallery2")
hotspot (453,553,29,28) action ShowMenu ("gallery3")
hotspot (484,553,29,28) action ShowMenu ("gallery4")
hotspot (761,540,130,44) action Return()
# A grid of buttons.
grid 2 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("cgcarry", "cgcarryunlock.png", xalign=0.65, yalign=1.18)
add g.make_button("cg1", "cg1unlock.png", xalign=0.35, yalign=1.18)
add g.make_button("cg2", "cg2unlock.png", xalign=0.65, yalign=0.73)
add g.make_button("cgprotect", "cgprotectunlock.png", xalign=0.35, yalign=0.75)
add g.make_button("cgfight", "cgfightunlock.png", xalign=0.64, yalign=0.31)
add g.make_button("cg3", "cg3unlock.png", xalign=0.35, yalign=0.3)