- Aug 13, 2019
- 1,082
- 4,430
Hello. I have a great gallery working on my game I am creating. However, I would like to create another gallery for a different purpose.
I would like to use the same gallery code I have for the use of displaying another type of gallery but I have a problum, every time I change the gallery code to fit the new gallery I get an error saying that it is not defined.
Here is my original gallery code.
What I want to do is make a copy of this gallery and have another link in the main menu to access it.
I would like to use the same gallery code I have for the use of displaying another type of gallery but I have a problum, every time I change the gallery code to fit the new gallery I get an error saying that it is not defined.
Here is my original gallery code.
Python:
###############GALLERY##################
init python:
# Step 1. Create the gallery object.
g = Gallery()
g.locked_button = "gallery/locked.png"
# Step 2. Add buttons and images to the gallery.
# A button that contains an image that automatically unlocks.
g.button("sex1")
g.condition("persistent.unlock_1")
g.image("nebulan01")
g.button("sex2")
g.condition("persistent.unlock_2")
g.image("image1")
g.button("sex3")
g.condition("persistent.unlock_3")
g.image("image1")
g.button("sex4")
g.condition("persistent.unlock_4")
g.image("image1")
g.button("sex5")
g.condition("persistent.unlock_5")
g.image("image1")
g.button("sex6")
g.condition("persistent.unlock_6")
g.image("image1")
g.button("sex7")
g.condition("persistent.unlock_7")
g.image("image1")
g.button("sex8")
g.condition("persistent.unlock_8")
g.image("image1")
g.button("sex9")
g.condition("persistent.unlock_9")
g.image("image1")
g.button("sex10")
g.condition("persistent.unlock_10")
g.image("image1")
g.button("sex11")
g.condition("persistent.unlock_11")
g.image("")
g.button("sex12")
g.condition("persistent.unlock_12")
g.image("")
g.button("sex13")
g.condition("persistent.unlock_13")
g.image("")
g.button("sex14")
g.condition("persistent.unlock_14")
g.image("")
g.button("sex15")
g.condition("persistent.unlock_15")
g.image("")
g.button("sex16")
g.condition("persistent.unlock_16")
g.image("")
g.button("sex17")
g.condition("persistent.unlock_17")
g.image("")
g.button("sex18")
g.condition("persistent.unlock_18")
g.image("")
g.button("sex19")
g.condition("persistent.unlock_19")
g.image("")
g.button("sex20")
g.condition("persistent.unlock_20")
g.image("")
screen gallery:
# Ensure this replaces the main menu.
tag menu
# The background.
add "backgroundscifi"
# A grid of buttons.
grid 4 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("sex1", "gallery/unlock1.png", xalign=0.5, yalign=0.5)
add g.make_button("sex2", "gallery/unlock2.png", xalign=0.5, yalign=0.5)
add g.make_button("sex3", "gallery/unlock3.png", xalign=0.5, yalign=0.5)
add g.make_button("sex4", "gallery/unlock4.png", xalign=0.5, yalign=0.5)
add g.make_button("sex5", "gallery/unlock5.png", xalign=0.5, yalign=0.5)
add g.make_button("sex6", "gallery/unlock6.png", xalign=0.5, yalign=0.5)
add g.make_button("sex7", "gallery/unlock7.png", xalign=0.5, yalign=0.5)
add g.make_button("sex8", "gallery/unlock8.png", xalign=0.5, yalign=0.5)
add g.make_button("sex9", "gallery/unlock9.png", xalign=0.5, yalign=0.5)
add g.make_button("sex10", "gallery/unlock10.png", xalign=0.5, yalign=0.5)
imagebutton:
idle "gallery/page2.png"
action ShowMenu("gallery2")
xalign 0.5
yalign 0.5
imagebutton:
idle "gallery/main menu.png"
action Return()
xalign 0.5
yalign 0.5
screen gallery2:
# Ensure this replaces the main menu.
tag menu
# The background.
add "backgroundscifi"
# A grid of buttons.
grid 4 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("sex11", "gallery/unlock11.png", xalign=0.5, yalign=0.5)
add g.make_button("sex12", "gallery/unlock12.png", xalign=0.5, yalign=0.5)
add g.make_button("sex13", "gallery/unlock13.png", xalign=0.5, yalign=0.5)
add g.make_button("sex14", "gallery/unlock14.png", xalign=0.5, yalign=0.5)
add g.make_button("sex15", "gallery/unlock15.png", xalign=0.5, yalign=0.5)
add g.make_button("sex16", "gallery/unlock16.png", xalign=0.5, yalign=0.5)
add g.make_button("sex17", "gallery/unlock17.png", xalign=0.5, yalign=0.5)
add g.make_button("sex18", "gallery/unlock18.png", xalign=0.5, yalign=0.5)
add g.make_button("sex19", "gallery/unlock19.png", xalign=0.5, yalign=0.5)
add g.make_button("sex20", "gallery/unlock20.png", xalign=0.5, yalign=0.5)
imagebutton:
idle "gallery/page1.png"
action ShowMenu("gallery")
xalign 0.5
yalign 0.5
imagebutton:
idle "gallery/main menu.png"
action Return()
xalign 0.5
yalign 0.5