Warning: The following guide will describe how to create an alternative CG or BG gallery without knowing almost anything about code, and even though it can look complex, I assure it's very simple instead. What we're going to build is not properly a real gallery (it doesn't use anything of the gallery code from the cookbook for example), but something that looks and works like a gallery, almost*.
Why using this guide instead of other shorter tutorials?: This is a good question! The answer is probably that someone may be in need of an easy way to make a very customized gallery without going crazy to edit an incomprehensible (for a lot of people) code. For instance, you may need to define the exact position of your single thumbnails and they're not aligned on a gird (like mine).
If you are one of these users, please go on reading:
What we need:
1) A background picture like mine with "locked" thumbnails (you can design them as you want):
2) All the CGs in a small format saved in the game folder (they must exactly correspond to the above frames in the background image, so design the frames in order to let the CGs fit inside them):
You also need hovered versions of your CGs' thumbanils, to make the button change when the cursor hovers it.
IMPORTANT: You must assign the same name to the idle and hover buttons with an underline _ in the middle (ex. "CG3_idle.png" and CG3_hover.png") so that the program can automatically set them by reading "CG3_%s.png" and so on (_s% is obligatory to make it work).
3) Write this code in the screens.rpy file:
Code: Select all
screen extra_events: tag menu add "YOUR BACKGROUND NAME.png" #Replace YOUR BACKGROUND NAME.png with your background file's name. ##Thumbnails buttons: here we put the small versions of our CGs we've previously saved in the game folder. if persistent.CG3_unlocked: imagebutton auto "CG3_%s.png" xpos 216 ypos 180 focus_mask True action ShowMenu('cg3') if persistent.CG4_unlocked: imagebutton auto "CG4_%s.png" xpos 615 ypos 250 focus_mask True action ShowMenu('cg4') ##Other buttons: here we put the other buttons we need in this screen, such as "Main menu" or "Next" and "Back" for example - if you have more than one page - and anything you want. imagebutton auto "button_mainmenu_%s.png" xpos 165 ypos 627 focus_mask True action ShowMenu('main_menu') imagebutton auto "next_%s.png" xpos 768 ypos 168 focus_mask True action ShowMenu('extra_events2')
Code: Select all
scene CG3 with Dissolve (1.0) $ persistent.CG3_unlocked = True
Code: Select all
screen cg1_1: tag menu imagemap: ground 'CG1_1.png' #CG1_1 is the first version of CG1 hotspot (0, 0, 1500, 720) action ShowMenu("cg1_2") screen cg1_2: tag menu imagemap: ground 'CG1_2.png' #CG1_2 is the second version of CG1 hotspot (0, 0, 1500, 720) action ShowMenu("cg1_n") screen cg1_n: tag menu imagemap: ground 'CG1_n.png' #CG1_n is the nst version of CG1 hotspot (0, 0, 1500, 720) action ShowMenu("extra_events")
Then you can create as many screens as many CGs (and variations) you have.
Tip: Moreover, if your CGs are more than the ones than can be contained in one single screen, you'll have to make new extra screens by copying and paste the code contained in the screen "extra_events" (you can name them "extra_events1", "extra_events2", and so on) and changing all the flags, CG files, etc. for the new page.
Important: Make sure you redirect to your gallery screen (in this case, to "extra_events) as you define the last version of your CGs, or you will create an endless loop.
Final considerations: It's definitely a very large amount of code lines, but with some "copy and paste" you can save the most of your time. If you need a complete customization, this guide will probably help you; if you don't, this could become a useless waste of time, so it's just your choice.
* I used the word "almost" because of one missing feature: as you can see, by using this gallery you will have the various versions of a CG after passing over the flag you've put in the script, but you'll not be able to move back to the previous one till the end of the series - in the order you've defined, when you'll be redirected to the extra screen.
EDIT: There was a mistake in point 4, but I fixed it just now.