Sorry to jump into your thread, but I'm a total noob as well and am hoping someone answers this thread, as I have almost the same problem as you.
The instructions and documentation are probably wonderful and helpful for the advanced users, but all I can get out of it is a deep sense of personal failure and frustration.
I read it over and over and I either never understand or what I do manage to try using almost never works. It's just so saddening. I stare at the open little renpy window the way I remember staring at difficult and unpleasant homework when I was a little kid.
I can only hope one day this will change, but so far it's been a while trying to learn it and I still can't even use the wiki for help so it's complete luck when things actually work for me.
Mostly my game attempt is just made of code learned from the example VNs and from the threads here in the forum, as I can't use the wiki for anything. Maybe it's because the wiki doesn't have images, so even when something seems simple in theory I don't get what would be what and what should look like what.
In any case, I managed to get a gallery button to show up in my menu, but that's it. I have no idea how to make the gallery work, and it's all very chaotic the way I have it now.
Maybe my code can help you with the button part, but I'm stuck with the rest.
I put the new_gallery.rpy file into my game folder and added the following code to my script.rpy, but I have no idea what else to do, so that things will actually show up in my gallery.
Code: Select all
init:
$ style.gallery_nav_frame.xpos = 800 - 10
$ style.gallery_nav_frame.xanchor = 1.0
$ style.gallery_nav_frame.ypos = 12
#My game is 640 by 480 pixels, should I modify the numbers above?
$ config.main_menu.insert(2, ('Gallery', "gallery", "True"))
label gallery:
# I added this bit here so that if they click the gallery button before beating the game, they'll see a BG telling them to come back later.
if not persistent.gallery_unlocked:
show lockedG_background
centered "You haven't unlocked this gallery yet."
$ renpy.full_restart()
# But maybe there was a better way of doing it, or would this be okay and not cause problems?
#Then the rest beneath is where I'm tearing my hair not knowing what to do even more. I added # in front of stuff until I get it figured out, since otherwise the game won't work.
python hide:
g = Gallery()
# The image used for locked buttons.
# g.locked_button = "gallery_locked.png"
# The background of a locked image.
# g.locked_background = "gallery_lockedbg.jpg"
# Frames added over unlocked buttons, in hover and idle states.
# g.hover_border = "gallery_hover.png"
# g.idle_border = "gallery_idle.png"
# An images used as the background of the various gallery pages.
g.background = "gallery_background.jpg"
# Lay out the gallery images on the screen.
# These settings lay images out 3 across and 4 down.
# The upper left corner of the gird is at xpos 10, ypos 20.
# They expect button images to be 155x112 in size.
g.grid_layout((3, 4), (10, 12), (160, 124))
# Show the background page.
g.page("Backgrounds")
# Our first button is a picture of the beach.
# g.button("thumb_beach.jpg")
#
# These show images, if they have been unlocked. The image name must
# have been defined using an image statement.
# g.unlock_image("bg beach daytime")
# g.unlock_image("bg beach nighttime")
#
# This shows a displayable...
# g.display("beach_sketch.jpg")
# ... if all prior images have been show.
# g.allprior()
# A second set of images.
# g.button("thumb_lighthouse.jpg")
# g.unlock_image("bg lighthouse day")
# g.unlock_image("bg lighthouse night")
# g.display("lighthouse_sketch.jpg")
# g.allprior()
# We can use g.page to introduce a second page.
g.page("Characters")
# g.button("thumb_eileen.jpg")
#
# Note that we can give image and unlock image more than one image
# at a time.
# g.unlock_image("bg lighthouse day", "eileen day happy")
# g.unlock_image("bg lighthouse day", "eileen day mad")
# Now, show the gallery.
g.show()
return
I might also have redundant stuff going on with the persistent thingie. :S
I'd like the gallery to look something like the ones in those games, where people can visit the gallery and see the empty spaces for the CGs not unlocked yet, and the spaces with the ones they've unlocked already:
Also, if anyone can point out a simple code to have the "are you sure you want to quite the game" pop-up be a nice little imagemap or some other cute custom look with an image, it would be great!!
Again, sorry for the partial thread-jacking, but since we had pretty much the same question, I figured it might be okay to ask here. ^^;