Issues:
1) Issues with trying to format the image with the hbox correctly and display the text correctly to the right of the image
2) pulling the information from the python 3d Dictionary
Image Details:
- Created each image as a daz3d render of each character
- base size 1920 x 1080
Gallery Setup:
Code: Select all
screen gameGallery():
tag menu
use game_menu(_("Extras"), scroll="viewport"):
style_prefix "imggallery"
label _("Character Introductions")
if Lightbox_image != "":
$ lb_image = im.Scale("imagegallery/" + Lightbox_image + ".jpg", 800, 600)
imagebutton:
idle lb_image
hover lb_image
xalign 0.5
yalign 0.5
focus_mask True
action SetVariable("Lightbox_image", "")
else:
frame:
xpos 40
ypos 20
background None
vpgrid:
cols 3
spacing 40
for q in imageGalleryList:
$ qimage = "imagegallery/" + q + ".jpg"
$ lb_image = im.Scale(qimage, 250, 150)
vbox:
spacing 10
imagebutton:
idle lb_image
hover lb_image
action SetVariable("Lightbox_image", q)
if q == "Michael":
$ chname = "Main Character (Default: " + q + ")"
else:
$ chname = q
text "Name: " + chname:
style "slot_name_text"
Gallery: https://imgur.com/drz1hup
Image clicked: https://imgur.com/iaBgYQf
Dictionary Setup:
Code: Select all
init python:
chardesc = [{
'Michael' : 'name',
'age' : '23',
'desc' : 'Main character who is ex-military intellegence officer who suffered past psychological trauma in the past'
},
{
'Rachel' : 'name',
'age' : '21',
'desc' : 'Long time best friend who has a secret love for the main character'
}]
Working Code that is not Working Correctly:
Code: Select all
if Lightbox_image != "":
$ lb_image = im.Scale("imagegallery/" + Lightbox_image + ".jpg", 800, 600)
hbox:
imagebutton:
idle lb_image
hover lb_image
xalign 0.5
yalign 0.5
focus_mask True
action SetVariable("Lightbox_image", "")
vbox:
#Lightbox_image is a variable that holds the name of the chararcter
text "Name: " + Lightbox_image:
style "char_style"
text "age: " + chardesc[[Lightbox_image]][age]:
style "char_style"
text "Description: " + chardesc[[Lightbox_image]][desc]:
style "char_style"
IE: If you click on the first image, Lightbox_image will hold the name Michael. so it should have the larger image on the left with the details from the dictionary on the right. Can anyone assist? And since I am new to renpy, please don't hesitate to let me know if I am using the wrong syntax entirely.
Ultimately if there is a tool that assist with this to find the proper image size to use and preview what the hbox code should look like before implenenting, it would be magical!