Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
I looked for answers on internet during like an hour, but nothing relevant... But it must be a frequent question (and already answered maybe) , sorry if I disturb you !
vbox:
text "title 1"
text "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"
text "title 2"
text "tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
viewport id "events_vp":
at xslide(x_depart=-120, x_final=360)
xysize (600, 517) xalign 0.5 ypos 550
draggable True mousewheel True scrollbars "vertical"
vbox:
for i in liste_events:
if i["actif"]:
hbox:
xalign 0.5
text _("Day") italic True color "#bbb" size 22
text str(i["day"]) italic True color "#bbb" size 22
text " - "+i["hour"] italic True color "#bbb" size 22
text i["details"] justify True
text ""
This does not fit, but with the effect I wanted (a window grey, then a window dark, then a grey etc...):
viewport id "events_vp":
at xslide(x_depart=-120, x_final=360)
xysize (600, 517) xalign 0.5 ypos 550
draggable True mousewheel True scrollbars "vertical"
vbox:
for i in liste_events:
if i["actif"]:
$ flip = not(flip)
window:
ymargin 2
if flip:
background "#1115"
else:
background "#3335"
hbox:
xalign 0.5
text _("Day") italic True color "#bbb" size 22
text str(i["day"]) italic True color "#bbb" size 22
text " - "+i["hour"] italic True color "#bbb" size 22
text i["details"] justify True
text ""
the problem is where you have put multiple objects inside a window, if you want the window to get it's size automatically, you can only have one object in it: