[Solved]How to make a gallery
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
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
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
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3785
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: How to make a gallery
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:
To
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"]
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"]
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
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
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
Last edited by rayminator on Sat Feb 17, 2018 3:28 pm, edited 1 time in total.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
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
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)
- poorlyformed
- Regular
- Posts: 53
- Joined: Mon Jan 22, 2018 11:43 am
- Projects: Shadowburg
- Tumblr: poorlyformed
- itch: poorlyformed
- Location: NYC
- Contact:
Re: How to make a gallery
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.
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.)
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
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
thanks you very much poorlyformed
only used part of your code
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
- poorlyformed
- Regular
- Posts: 53
- Joined: Mon Jan 22, 2018 11:43 am
- Projects: Shadowburg
- Tumblr: poorlyformed
- itch: poorlyformed
- Location: NYC
- Contact:
Re: How to make a gallery
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.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
It works just fine without itpoorlyformed 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.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
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
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
- poorlyformed
- Regular
- Posts: 53
- Joined: Mon Jan 22, 2018 11:43 am
- Projects: Shadowburg
- Tumblr: poorlyformed
- itch: poorlyformed
- Location: NYC
- Contact:
Re: How to make a gallery
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
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.
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")
For the latter, you need to add 'use navigation', like I have it in the code above.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
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
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
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3785
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: How to make a gallery
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.
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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- poorlyformed
- Regular
- Posts: 53
- Joined: Mon Jan 22, 2018 11:43 am
- Projects: Shadowburg
- Tumblr: poorlyformed
- itch: poorlyformed
- Location: NYC
- Contact:
Re: How to make a gallery
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.
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.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How to make a gallery
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
- poorlyformed
- Regular
- Posts: 53
- Joined: Mon Jan 22, 2018 11:43 am
- Projects: Shadowburg
- Tumblr: poorlyformed
- itch: poorlyformed
- Location: NYC
- Contact:
Re: How to make a gallery
okay, just use
Code: Select all
imagebutton "YOURIMAGENAME.png" action Return() alt _("Return") xalign 0.5 yalign 0.5
Who is online
Users browsing this forum: Bing [Bot], GetOutOfMyLab, Ocelot