Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/screens.rpy", line 543: expected statement.
gallery_cg_items = ["cg1","cg2"]
^
File "game/screens.rpy", line 545: expected statement.
gal_rows = 3
^
File "game/screens.rpy", line 546: expected statement.
gal_cols = 3
^
File "game/screens.rpy", line 548: expected statement.
cg_thumbnail_x = 150
^
File "game/screens.rpy", line 549: expected statement.
cg_thumbnail_y = 300
^
File "game/screens.rpy", line 553: expected statement.
gal_cells = gal_rows * gal_cols
^
File "game/screens.rpy", line 554: expected statement.
g_cg = Gallery()
^
File "game/screens.rpy", line 555: expected statement.
for gal_item in gallery_cg_items:
^
File "game/screens.rpy", line 559: expected statement.
g_cg.transition = fade
^
File "game/screens.rpy", line 560: expected statement.
cg_page=0
^
Ren'Py Version: Ren'Py 6.99.10.1227
Code: Select all
#CG Gallery
init-1:
image cg1 = "images/steinsgate3.jpg"
image cg2 = "images/steinsgate2.jpg"
## and so on
#Galleries settings - start
#list the CG gallery images here:
gallery_cg_items = ["cg1","cg2"]
#how many rows and columns in the gallery screens?
gal_rows = 3
gal_cols = 3
#thumbnail size in pixels:
cg_thumbnail_x = 150
cg_thumbnail_y = 300
#the setting above (267x150) will work well with 16:9 screen ratio. Make sure to adjust it, if your are using 4:3 or something else.
#Galleries settings - end
gal_cells = gal_rows * gal_cols
g_cg = Gallery()
for gal_item in gallery_cg_items:
g_cg.button(gal_item + " butt")
g_cg.image(gal_item)
g_cg.unlock(gal_item)
g_cg.transition = fade
cg_page=0
init +1 python:
#Here we create the thumbnails. We create a grayscale thumbnail image for BGs, but we use a special "locked" image for CGs to prevent spoilers.
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), cg_thumbnail_x, cg_thumbnail_y))
screen extra:
tag menu
use navigation
frame background None xpos 10:
grid gal_rows gal_cols:
ypos 10
$ i = 0
$ next_cg_page = cg_page + 1
if next_cg_page > int(len(gallery_cg_items)/gal_cells):
$ next_cg_page = 0
for gal_item in gallery_cg_items:
$ i += 1
if i <= (cg_page+1)*gal_cells and i>cg_page*gal_cells:
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.png", cg_thumbnail_x, cg_thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
null
frame:
yalign 0.97
vbox:
if len(gallery_cg_items)>gal_cells:
textbutton _("Next Page") action [SetVariable('cg_page', next_cg_page), ShowMenu("extra")]