Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Probably a stupid question, but where do I put the code in my own game? I tried putting all of the .rpy files into my game folder (adjusted for just the gallery_b code), and the main menu gui does show Gallery but when I click on it it tells me that "gallery_b is not a screen or label". Should I have put the code elsewhere?

if you're just using the gallery then you only need 3 files gallery_setup.rpy, gallery.rpy and both.rpy they are all in the scripts folder

and it should be "gallery_B" upper case letter -> B 

Thanks so much, the gallery is openable now! Unfortunately, being able to use the gallery has revealed a couple new problems. In gallery_setup, it will only show images designated img1 or img2; "gallery_items.append(GalleryItem("name", ["img3"] ))", for example, shows a locked screen even if I have  "image img3 = ("images/gallery/BE2.png")" and have viewed it in-game and double-checked the file name is correct. I also can't seem to change the background color for the Next/Previous buttons, and even removing the code for them entirely from gallery.rpy doesn't remove them from the game. I thought I might've accidentally copied the code into a different file, but I can't find it anywhere.

remember there are two separate gallery layouts there A and B (make sure you edit the correct one you are using)

when you define an image for the gallery 

image img3 = ("images/gallery/gallery3.jpg")

you must show img3 not gallery3 before it is it unlocked in the galler, you can:

show img3
or
scene img3 

the background for those buttons are in the code for the button

    if gallery_page > 0:
        textbutton "{color=#000}Previous{/color}":
            action SetVariable("gallery_page", gallery_page - 1)
            xalign 0.3
            yalign 0.98
            background "#fff8"  #<<--- it is what it is 

fff is white but with an 8 in the alpha channel make it semi-transparent (looks light grey)

The right images are showing up now, thank you! And that didn't fix the problem with the next button, but I figured it out anyway; for some reason I had a "gallery_b.rpyc" file in my folder with no corresponding "gallery_b.rpy", and deleting that made everything work perfectly. Thanks so much for the help! 

you're welcome

good luck with your project