- Aug 13, 2019
- 1,082
- 4,430
Hi, Im a noob developer of a game.
I wanted a very simple gallery code to use for displaying HD renders for anyone who is playing my game and reaches a specific place in my game and unlocks a gallery.
So I am using the code got from here.
It is great and works perfectly. However there are a few things I wanted to change but I do not know how. I have tried to figure it out but cant seem to find a solution, so if there is someone on here who can help, I would be very grateful.
The Gallery code I used is below.
_________________________________________________________________________
#REMINDERS.
#PLACE THIS CODE INTO ANY PART OF YOUR SCRIPT TO UNLOCK A GALLERY IMAGE. REMEMBER TO CHANGE THE NAME FROM end1 to end2 or end3 ect...
#$ persistent.end1 = True
init python:
# Step 1. Create the gallery object.
g = Gallery()
# This button has a condition associated with it, allowing the game
# to choose which images unlock.
g.button("end1")
g.condition("persistent.end1")
g.image("images/gallery/end1.jpg")
g.button("end2")
g.condition("persistent.end2")
g.image("images/gallery/end2.jpg")
g.button("end3")
g.condition("persistent.end3")
g.image("images/gallery/end3.jpg")
g.button("end4")
g.condition("persistent.end4")
g.image("images/gallery/end4.jpg")
g.button("end5")
g.condition("persistent.end5")
g.image("images/gallery/end5.jpg")
g.button("end6")
g.condition("persistent.end6")
g.image("images/gallery/end6.jpg")
# Step 3. The gallery screen we use.
screen gallery:
# Ensure this replaces the main menu.
tag menu
# The background.
add "images/gallery/background.jpg"
# A grid of buttons.
grid 3 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("end1", "images/gallery/endsmall1.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end2", "images/gallery/endsmall2.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end3", "images/gallery/endsmall3.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end4", "images/gallery/endsmall4.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end5", "images/gallery/endsmall5.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end6", "images/gallery/endsmall6.jpg", locked = "images/gallery/lock.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 "Previous" action ShowMenu("gallery") xalign 0.5 yalign 0.5
textbutton "Next" action ShowMenu() xalign 0.5 yalign 0.5
textbutton "Return" action Return() xalign 0.5 yalign 0.5
_______________________________________________________________________________________
So my problem is that in this code, the gallery can only hold 6 images at a time, and I was wondering if I can change that to something else so I can add more. Also, the gallery images are spaced pretty far apart, and was wondering if I can have them closer.
Also when my main image is displayed in the gallery, the user can view it but if he clicks on the image it disappears and goes back to the gallery page, is it possible to give the viewer the option to download or save the image to his computer for displaying as a desktop background, I would like to give the player that option if they want.
Anyways, any help is greatly appreciated in this, and if it cant be done, I would like to know that also.
Thanks so much.
I wanted a very simple gallery code to use for displaying HD renders for anyone who is playing my game and reaches a specific place in my game and unlocks a gallery.
So I am using the code got from here.
You must be registered to see the links
It is great and works perfectly. However there are a few things I wanted to change but I do not know how. I have tried to figure it out but cant seem to find a solution, so if there is someone on here who can help, I would be very grateful.
The Gallery code I used is below.
_________________________________________________________________________
#REMINDERS.
#PLACE THIS CODE INTO ANY PART OF YOUR SCRIPT TO UNLOCK A GALLERY IMAGE. REMEMBER TO CHANGE THE NAME FROM end1 to end2 or end3 ect...
#$ persistent.end1 = True
init python:
# Step 1. Create the gallery object.
g = Gallery()
# This button has a condition associated with it, allowing the game
# to choose which images unlock.
g.button("end1")
g.condition("persistent.end1")
g.image("images/gallery/end1.jpg")
g.button("end2")
g.condition("persistent.end2")
g.image("images/gallery/end2.jpg")
g.button("end3")
g.condition("persistent.end3")
g.image("images/gallery/end3.jpg")
g.button("end4")
g.condition("persistent.end4")
g.image("images/gallery/end4.jpg")
g.button("end5")
g.condition("persistent.end5")
g.image("images/gallery/end5.jpg")
g.button("end6")
g.condition("persistent.end6")
g.image("images/gallery/end6.jpg")
# Step 3. The gallery screen we use.
screen gallery:
# Ensure this replaces the main menu.
tag menu
# The background.
add "images/gallery/background.jpg"
# A grid of buttons.
grid 3 3:
xfill True
yfill True
# Call make_button to show a particular button.
add g.make_button("end1", "images/gallery/endsmall1.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end2", "images/gallery/endsmall2.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end3", "images/gallery/endsmall3.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end4", "images/gallery/endsmall4.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end5", "images/gallery/endsmall5.jpg", locked = "images/gallery/lock.png", xalign=0.5, yalign=0.5)
add g.make_button("end6", "images/gallery/endsmall6.jpg", locked = "images/gallery/lock.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 "Previous" action ShowMenu("gallery") xalign 0.5 yalign 0.5
textbutton "Next" action ShowMenu() xalign 0.5 yalign 0.5
textbutton "Return" action Return() xalign 0.5 yalign 0.5
_______________________________________________________________________________________
So my problem is that in this code, the gallery can only hold 6 images at a time, and I was wondering if I can change that to something else so I can add more. Also, the gallery images are spaced pretty far apart, and was wondering if I can have them closer.
Also when my main image is displayed in the gallery, the user can view it but if he clicks on the image it disappears and goes back to the gallery page, is it possible to give the viewer the option to download or save the image to his computer for displaying as a desktop background, I would like to give the player that option if they want.
Anyways, any help is greatly appreciated in this, and if it cant be done, I would like to know that also.
Thanks so much.