Here's the code I used :
Code: Select all
init:
# Position the navigation on the right side of the screen.
$ style.gallery_nav_frame.xpos = 800 - 10
$ style.gallery_nav_frame.xanchor = 1.0
$ style.gallery_nav_frame.ypos = 12
# Add the gallery to the main menu.
$ config.main_menu.insert(2, ('Gallery', "gallery", "True"))
# The entry point to the gallery code.
label gallery:
python hide:
# Construct a new gallery object.
g = Gallery()
# The image used for locked buttons.
g.locked_button = "gallery_locked.png"
# The background of a locked image.
g.locked_background = "gallery_lockedbg.jpg"
# Frames added over unlocked buttons, in hover and idle states.
g.hover_border = "gallery_hover.png"
g.idle_border = "gallery_idle.png"
# An images used as the background of the various gallery pages.
g.background = "gallery_background.jpg"
# Lay out the gallery images on the screen.
# These settings lay images out 3 across and 4 down.
# The upper left corner of the gird is at xpos 10, ypos 20.
# They expect button images to be 155x112 in size.
g.grid_layout((3, 4), (10, 12), (160, 124))
# Show the background page.
g.page("Art bonus")
# Our first button is a picture of the beach.
g.button("thumb_eileen.jpg")
g.button("thumb_eileen.jpg")
g.button("thumb_eileen.jpg")
g.button("thumb_eileen.jpg")
g.button("thumb_eileen.jpg")
g.button("thumb_eileen.jpg")
g.button("thumb_eileen.jpg")
g.button("thumb_eileen.jpg")
#
# These show images, if they have been unlocked. The image name must
# have been defined using an image statement.
g.unlock_image("bg beach nighttime")
g.unlock_image("bg beach nighttime")
#
# This shows a displayable...
g.display("beach_sketch.jpg")
# ... if all prior images have been show.
g.allprior()
# A second set of images.
g.button("thumb_lighthouse.jpg")
g.unlock_image("bg lighthouse day")
g.unlock_image("bg lighthouse night")
g.display("lighthouse_sketch.jpg")
g.allprior()
# We can use g.page to introduce a second page.
g.page("Ryou's CG")
g.button("ryou_cg_biblio_mini.jpg")
g.unlock_image("ryou cg biblio")
g.button("CG Ryou Heroine mini.png")
g.unlock_image("CG Ryou Heroine")
g.button("Ryou CG4 mini.png")
g.unlock_image("Ryou CG4")
g.button("New CG Ryou 5 mini.png")
g.unlock_image("New CG Ryou 5 mini")
g.button("recit mere meilleur ami 1 mini.png")
g.unlock_image("recit mere meilleur ami1")
g.button("recit mere meilleur ami 2 mini.png")
g.unlock_image("recit mere meilleur ami2")
g.button("recit mere meilleur ami 3 mini.png")
g.unlock_image("recit mere meilleur ami 3 mini.png")
g.button("recit mere meilleur ami 4 mini.png")
g.unlock_image("recit mere meilleur ami4")
g.button("Ryou CG3 mini.png")
g.unlock_image("Ryou CG3")
g.page("Kojiro's CG")
g.button("CG Kojiro new mini.png")
g.unlock_image("CG Kojiro new")
g.button("CG's kojiro passe3 mini.png")
g.unlock_image("CG's kojiro passe3")
g.button("CG's kojiro passe4 mini.png")
g.unlock_image("CG's kojiro passe4")
g.button("kojiro enfant CG mini.png")
g.unlock_image("kojiro enfant CG")
g.button("kojiro eri CG2 mini.png")
g.unlock_image("kojiro eri CG2")
g.button("kojiro heroine CG fini mini.png")
g.unlock_image("kojiro heroine CG fini")
g.button("CG Heroine mini.png")
g.unlock_image("CG Heroine")
g.button("new CG Kojiro Eri mini.png")
g.unlock_image("new CG Kojiro Eri")
g.page("Autres")
g.button("Eri Aru CG mini.png")
g.unlock_image("Eri Aru CG")
g.button("heroine CG chemin ryou fini mini.png")
g.unlock_image("heroine CG chemin ryou fini")
g.button("Eri enfant CG mini.png")
g.unlock_image("Eri enfant CG")
g.button("leprechaun CG mini.png")
g.unlock_image("leprechaun CG")
g.button("leprechaun CG1 mini.png")
g.unlock_image("leprechaun CG1")
g.button("leprechaun CG2 mini.png")
g.unlock_image("leprechaun CG2")
g.button("mere meilleur ami CG mini.png")
g.unlock_image("mere meilleur ami CG")
#
# Note that we can give image and unlock image more than one image
# at a time.
g.unlock_image("bg lighthouse day", "eileen day happy")
g.unlock_image("bg lighthouse day", "eileen day mad")
# Now, show the gallery.
g.show()
jump main_menu_screen