Page 2 of 3
Re: How to make a gallery
Posted: Wed Feb 14, 2018 6:46 am
by rayminator
I only removed it because it given me init +1 python error
but it fixed itself after i have created a new game
so that part is back in
but the images won't unlock not in less I remove this part g_cg.unlock(gal_item)
If I put it like this #g_cg.unlock(gal_item) to cancel it out all images show
but if it's like this g_cg.unlock(gal_item) it only shows the gallocked image and if I play through the game the image doesn't unlock
Re: How to make a gallery
Posted: Wed Feb 14, 2018 4:31 pm
by Imperf3kt
That sounds odd and is unexpected behaviour.
Try updating or reinstalling Ren'Py. There may have been an error during install or your initial download.
When I have enough time to, I'll put together a very basic game which includes a gallery.
You can then test it by placing it in your projects directory. It should work then.
There is one thing I noticed though, in the code you posted earlier. You have 12 items in your list, but only 11 of them actually exist.
Perhaps try changing:
Code: Select all
init python:
#Galleries settings - start
#list the CG gallery images here:
gallery_cg_items = ["bg sc01", "bg sc02", "bg sc03", "bg sc04", "bg sc05", "bg sc06", "bg sc07", "bg sc08", "bg sc09", "bg sc10", "bg sc11", "bg sc12"]
To
Code: Select all
init python:
#Galleries settings - start
#list the CG gallery images here:
gallery_cg_items = ["bg sc01", "bg sc02", "bg sc03", "bg sc04", "bg sc05", "bg sc06", "bg sc07", "bg sc08", "bg sc09", "bg sc10", "bg sc11"]
Re: How to make a gallery
Posted: Wed Feb 14, 2018 5:42 pm
by rayminator
here is my copy
this from a new copy of renpy my version is Ren'Py 6.99.14.1
and it still won't unlock and same thing if I remove this g_cg.unlock(gal_item)the images show
thanks for the help anyways it doesn't seem to want to work
Re: How to make a gallery
Posted: Thu Feb 15, 2018 11:53 am
by rayminator
I figure how to use this code here at Image Gallery, Music Room, and Replay Actions on renpy web-page (site down)
but i need to find a to get the image to show after the image been unlocked
Code: Select all
# Call make_button to show a particular button.
add g.make_button("dark", "gallocked.png", xalign=0.5, yalign=0.5)
add g.make_button("dawn", "gallocked.png", xalign=0.5, yalign=0.5)
add g.make_button("end1", "gallocked.png", xalign=0.5, yalign=0.5)
add g.make_button("end2", "gallocked.png", xalign=0.5, yalign=0.5)
add g.make_button("end3", "gallocked.png", xalign=0.5, yalign=0.5)
add g.make_button("end4", "gallocked.png", xalign=0.5, yalign=0.5)
add g.make_button("dark mary", "gallocked.png", xalign=0.5, yalign=0.5)
add g.make_button("dawn mary", "gallocked.png", xalign=0.5, yalign=0.5)
Re: How to make a gallery
Posted: Thu Feb 15, 2018 12:06 pm
by poorlyformed
That's what I used to make my gallery. Here's my code. I added some notes to explain what everything is and what to change.
Code: Select all
init python:
g = Gallery()
g.button("btn_cg1") ## this creates the button/thumbnail for your gallery. also, everything in quotations you would rename to whatever you're using for your files
g.condition("persistent.cg1_unlocked") ## you want to make sure you unlock the CG in your script with $ persistent.cg1_unlocked = True (put that where the CG appears)
g.image ("cg1a") ## this is your CG
g.image ("cg1b") ## if you want more than one image to show from one thumbnail, just add them into the button,
g.transition = dissolve
screen gallery:
tag menu
add "gui/menus/gallery_menu_bg.png"
use navigation
default curpage = "main_gal" ## if you have more than one page in your gallery. if you don't, you can delete this.
## Gallery navigation
imagebutton auto "gui/menus/gallery_main_%s.png" xpos 567 ypos 170 action SetScreenVariable("curpage", "main_gal") alt _("Main Gallery")
imagebutton auto "gui/menus/gallery_sean_%s.png" xpos 710 ypos 170 action SetScreenVariable("curpage", "sean_gal") alt _("Sean's Gallery")
if curpage == "main_gal":
add g.make_button("btn_cg1", "thumb_cg1", locked="cglocked", xpadding=0, ypadding=0) xpos 570 ypos 250
## ok, so the first thing in quotations is the name of the button you made above. the second is the name of the thumbnail image, which you would have to create. the third is the locked image, what will show when the CG is still locked. xpadding and ypadding you don't have to worry about unless you're creating a hover border around the image. and then xpos and ypos is to position the image on the page.
if curpage == "sean_gal":
add g.make_button("btn_cg1", "thumb_cg1", locked="cglocked", xpadding=0, ypadding=0) xpos 570 ypos 250
so the only things you would have to change in this code is the names for all the files (everything in quotation marks) and the positions of the buttons. For example, instead of "btn_cg1" you might want to use "btn_dark" (but you can name them whatever you want, as long as it's consistent and makes sense to you.)
Re: How to make a gallery
Posted: Thu Feb 15, 2018 12:27 pm
by rayminator
thanks you very much poorlyformed
only used part of your code
Code: Select all
add g.make_button("btn_cg1", "thumb_cg1", locked="cglocked", xpadding=0, ypadding=0) xpos 570 ypos 250
Re: How to make a gallery
Posted: Thu Feb 15, 2018 12:59 pm
by poorlyformed
Do you mean that you're not using the rest of it? Because at the very least, you need the g.condition part to tell it to unlock the image in the gallery, although I'm not sure if that will even work without the rest of the code.
Re: How to make a gallery
Posted: Thu Feb 15, 2018 1:18 pm
by rayminator
poorlyformed wrote: ↑Thu Feb 15, 2018 12:59 pm
Do you mean that you're not using the rest of it? Because at the very least, you need the g.condition part to tell it to unlock the image in the gallery, although I'm not sure if that will even work without the rest of the code.
It works just fine without it
Re: How to make a gallery
Posted: Thu Feb 15, 2018 2:53 pm
by rayminator
Update:
Still need help to add image for the textbutton and how add the main menu to it
I'll looking through the pages of the site search doesn't work
Re: How to make a gallery
Posted: Thu Feb 15, 2018 3:38 pm
by poorlyformed
I'm not sure what you mean by "add image for the textbutton."
For the main menu, do you mean to add the gallery link to the main menu, or to add the navigation to the gallery screen. For the former, you can just add
Code: Select all
textbutton "Gallery" action ShowMenu("gallery")
The "gallery" in parentheses would be whatever you've actually named your gallery screen.
For the latter, you need to add 'use navigation', like I have it in the code above.
Re: How to make a gallery
Posted: Thu Feb 15, 2018 3:53 pm
by rayminator
i want to change the text from return to an image
something like this
google image click the link to find out what i mean
now how add the main menu to the gallery
tried using this use game_menu(_("Image Gallery"), scroll="viewport"): but it didn't work
but i am still looking
and Imperf3kt it look like you had the same issue that I'm having with that gallery that I want to use
viewtopic.php?f=8&t=45762
Re: How to make a gallery
Posted: Thu Feb 15, 2018 4:17 pm
by Imperf3kt
I didn't actually get to look at it last night, I got a little busy working on a 3D print file and completely forgot.
I'm planning to check it tonight, but I don't think I'll have a lot of time as I have some appointments late in the afternoon in a town an hour away from home. I don't expect to get around to it until late, so I may not look until tomorrow.
Its currently 7:15am here.
Re: How to make a gallery
Posted: Thu Feb 15, 2018 4:33 pm
by poorlyformed
ah, ok. You can just use an imagebutton for that. Could you paste your code and then I can tell you what you need to change.
Also, do you have the Navigation part of the main/game menu set up? If you do, then you just add 'use navigation' to your gallery screen.
Re: How to make a gallery
Posted: Thu Feb 15, 2018 4:55 pm
by rayminator
this what I want to change
Code: Select all
# Step 3. The gallery screen we use.
screen gallery:
use navigation
# Ensure this replaces the main menu.
tag menu
# The background.
add "scnes11"
# A grid of buttons.
grid 3 3:
xfill False
yfill False
ypos 100
xpos 200
# Call make_button to show a particular button.
add g.make_button("dark", "all162b", locked="gallocked", xalign=0.5, yalign=0.5)
add g.make_button("dawn", "all162b", locked="gallocked", xalign=0.5, yalign=0.5)
add g.make_button("end1", "all162b", locked="gallocked", xalign=0.5, yalign=0.5)
add g.make_button("end2", "all162b", locked="gallocked", xalign=0.5, yalign=0.5)
add g.make_button("end3", "all162b", locked="gallocked", xalign=0.5, yalign=0.5)
add g.make_button("end4", "all162b", locked="gallocked", xalign=0.5, yalign=0.5)
add g.make_button("dark mary", "all162b", locked="gallocked", xalign=0.5, yalign=0.5)
add g.make_button("dawn mary", "all162b", locked="gallocked", 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 "Return" action Return() xalign 0.5 yalign 0.5 <-- this what I want to change into an image
Re: How to make a gallery
Posted: Thu Feb 15, 2018 5:08 pm
by poorlyformed
okay, just use
Code: Select all
imagebutton "YOURIMAGENAME.png" action Return() alt _("Return") xalign 0.5 yalign 0.5