https://drive.google.com/open?id=0B7tyz ... authuser=0
Code: Select all
init python:
#list of images
gallery_cg_items = ["splash",
"bridge_day",
"bridge_night",
"club_day",
"club_night",
"fronthouse_day",]
# Page 2.
#the rows and columns in the screen
gal_rows = 3
gal_cols = 2
#thumbnail size in pixels
thumbnail_x = 260
thumbnail_y = 183
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.idle_border="assets/UI/gal_idle.png"
g_cg. hover_border = "assets/UI/gal_hover.png"
g_cg.transition = dissolve
cg_page=0
init +1 python:
#We made the lock buttons and such here
for gal_item in gallery_cg_items:
renpy.image(gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
screen cg_gallery:
tag menu
add "pref_bg"
imagemap:
auto "assets/UI/gallery_%s.png"
hotspot (1103,15,148,121) action Return()
hotspot (45,151,198,58) action [SetVariable('cg_page', 0), ShowMenu("cg_gallery")]
#hotspot (45,218,198,58) action [SetVariable('cg_page', 1), ShowMenu("cg_gallery")]
#hotspot (45,290,198,58) action [SetVariable('cg_page', 2), ShowMenu("cg_gallery")]
#hotspot (45,355,198,58) action [SetVariable('cg_page', 3), ShowMenu("cg_gallery")]
frame background None xpos 143:
grid gal_rows gal_cols:
ypos 168
xpos 185
$ 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("assets/locked.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, background=None, bottom_margin=24)
for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
null