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 was setting up a second window at the top of the screen to show information for the player and succeeded. I've gotten it to say whatever I input in the code.
I have one thing that annoys me though. When it displays, it looks like this:
Summer 10
5 days remaining
As you can see, the text aligns to the left. I'd like for the Summer 10 portion to be centered with the 5 days remaining portion.
When screens and functions are involved how would one go about doing this? Or is it even possible to do such a thing?
I've posted what I think is the relevant code to help solve this. I appreciate the help.
The Old Guard is at His Limit. The time is near to usher in the New Guard.
The Great Horror is soon to be free.
Clarevine is the key.
"Unsound Minds: The Clarevine Epoch" is a yuri visual novel that shatters english visual novel norms and aims to blend Christianity and the Cthulhu Mythos to tell a deep and dark story that you'll enjoy. You can follow the Kickstarter here.
Stay sound and persist through the chaos,
NocturneLight
a = "{size=+5}" + Month + " " + str(Date) + "{/size}"
b = str(DaysRemaining) + " days remaining"
return a, b
This doesn't affect how your function is called, but only what is returned. This returns a tuple instead of a single string. In your screen code, then you break it into two different elements like this:
screen info():
vbox:
xalign 0.5
yalign 0.0
add "logo.thumbnail.png"
vbox:
xalign 0.5
yalign 0.0
text "[date[0]]" xalign 0.5 font "berylium rg.ttf" #I removed the font tag from the string earlier and put it here
text "[date[1]]" xalign 0.5 font "berylium rg.ttf"
You can edit the style properties for each line of text separately and properties like alignment are relative to the element that they are in which is a vbox in this case.
a = "{size=+5}" + Month + " " + str(Date) + "{/size}"
b = str(DaysRemaining) + " days remaining"
return a, b
This doesn't affect how your function is called, but only what is returned. This returns a tuple instead of a single string. In your screen code, then you break it into two different elements like this:
screen info():
vbox:
xalign 0.5
yalign 0.0
add "logo.thumbnail.png"
vbox:
xalign 0.5
yalign 0.0
text "[date[0]]" xalign 0.5 font "berylium rg.ttf" #I removed the font tag from the string earlier and put it here
text "[date[1]]" xalign 0.5 font "berylium rg.ttf"
You can edit the style properties for each line of text separately and properties like alignment are relative to the element that they are in which is a vbox in this case.
That definitely centered it. Thanks again!
The Old Guard is at His Limit. The time is near to usher in the New Guard.
The Great Horror is soon to be free.
Clarevine is the key.
"Unsound Minds: The Clarevine Epoch" is a yuri visual novel that shatters english visual novel norms and aims to blend Christianity and the Cthulhu Mythos to tell a deep and dark story that you'll enjoy. You can follow the Kickstarter here.
Stay sound and persist through the chaos,
NocturneLight