And the code works great, however... I want to show images from a screen which show like a gif when played. How can I do that?
g.image ("cg1a") is what I need to change, but I really don't know how to call a screen there or a label? Any help will be really appreciated!!
This is the full code:
Code: Select all
init python:
g = Gallery()
g.button("btn_cg1") ## this creates the button/thumbnail for your gallery. also, everything in quotations you would rename to whatever you're using for your files
g.condition("persistent.cg1_unlocked") ## you want to make sure you unlock the CG in your script with $ persistent.cg1_unlocked = True (put that where the CG appears)
g.image ("cg1a") ## this is your CG
g.image ("cg1b") ## if you want more than one image to show from one thumbnail, just add them into the button,
g.transition = dissolve
g.button("btn_cg2")
g.condition("persistent.cg2_unlocked")
g.image ("cg2a")
g.image ("cg2b")
g.transition = dissolve
screen gallery:
tag menu
add "gui/history_ground.png"
use navigation
default curpage = "main_gal" ## if you have more than one page in your gallery. if you don't, you can delete this.
## Gallery navigation
imagebutton auto "gui/filepage1_%s.png" xpos 567 ypos 170 action SetScreenVariable("curpage", "main_gal") alt _("Main Gallery")
imagebutton auto "gui/filepage2_%s.png" xpos 710 ypos 170 action SetScreenVariable("curpage", "sean_gal") alt _("Sean's Gallery")
if curpage == "main_gal":
add g.make_button("btn_cg1", "thumb_cg1", locked="gallocked", xpadding=0, ypadding=0) xpos 570 ypos 250
add g.make_button("btn_cg2", "thumb_cg2", locked="gallocked", xpadding=0, ypadding=0) xpos 770 ypos 250
## ok, so the first thing in quotations is the name of the button you made above. the second is the name of the thumbnail image, which you would have to create. the third is the locked image, what will show when the CG is still locked.
## xpadding and ypadding you don't have to worry about unless you're creating a hover border around the image. and then xpos and ypos is to position the image on the page.
if curpage == "sean_gal":
add g.make_button("btn_cg1", "thumb_cg1", locked="gallocked", xpadding=0, ypadding=0) xpos 570 ypos 250