I´m trying to make a Gallery for my game.
For images, Music and Scenes.
So far I´ve done this code (wich I changed a little bit):
Code: Select all
transform slowpan:
xpos 0.0
block:
easein_quad 2.0 xpos 0.1
easein_quad 2.0 xpos 0.0
repeat
init python:
# Step 1. Create the gallery object.
g = Gallery()
# Step 2. Add buttons and images to the gallery.
# A button that contains an image that automatically unlocks.
g.button("dawn")
g.image("dawn1")
g.unlock("end1")
# 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.transform(slowpan)
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("hospital1")
g.image("hospital1")
g.image("hospital1")
g.image("hospital1")
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
use game_menu(_("gallery"), scroll="viewport"):
style_prefix "gallery"
# The background.
#add "dawn1"
# A grid of buttons.
grid 3 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("dark", "01.jpg", "05", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
add g.make_button("dawn", "02.jpg", "05", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
add g.make_button("end1", "03.jpg", "05", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
add g.make_button("end2", "04.jpg", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
add g.make_button("end3", "05", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
add g.make_button("end4", "06.jpg", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
add g.make_button("dark mary", "07", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
add g.make_button("dawn mary", "08", hover_border="02.jpg", idle_border="03.jpg", xalign=0.0, yalign=0.0)
# The screen is responsible for returning to the main menu. It could also
# navigate to other gallery screens.
textbutton "Return" action Return() xalign 0.25 yalign 0.0
Code: Select all
textbutton "Gallery" action ShowMenu("gallery")
1) Find 3 different buttons to go to the 3 different galleries, Music, Images and Scenes.
2) If you are in any of these 3, find buttons like the Save page, where you can select different pages for, for example, images, like an album of photos.
Thanks!