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'm trying to create a glossary page. I want to know if there is a way of doing it better. For example, do I have to use a bunch of lines of "text" codes for it? Is there one better suited for using much longer bodies of text? Isn't there a limit to how long the "text" code can be for this?
I just want to include at least 5 words with their definitions.
screen gallery_glossary_section(): #
tag menu
frame:
xalign 0.5
yalign 0.04
hbox:
text "Glossary" size 66
frame:
xalign 0.4
yalign 0.2
vbox:
text "word"
text "11111111111111111111111111111111111111111111111111111111111111"
text "22222222222222222222222222222222222222222222222222222222222222"
text "33333333333333333333333333333333333333333333333333333333333333"
text "44444444444444444444444444444444444444444444444444444444444444"
text "55555555555555555555555555555555555555555555555555555555555555"
frame:
xalign 0.4
yalign 0.6
vbox:
text "word 2"
text "11111111111111111111111111111111111111111111111111111111111111"
text "22222222222222222222222222222222222222222222222222222222222222"
text "33333333333333333333333333333333333333333333333333333333333333"
text "44444444444444444444444444444444444444444444444444444444444444"
text "55555555555555555555555555555555555555555555555555555555555555"
frame:
xalign 0.022
yalign 0.022
vbox:
textbutton "Return" action Return()
No, you don't have to use multiple text displayables. Here is an example: https://i.imgur.com/zFWEQsg.png
That defines a single string (I used triple quoted string so I can use line breaks naturally). It is then is displayed by text displayable in viewport.
Text does have some limits, as it didn't like whole script of bee movie dumped into it, it cut off after certain amount of lines. But unless you are planning to display whole novel in one screen, that should not be a problem.
While I need help figuring out one minor lingering bug in it, I've got a screen I built out based on another glossary model found in the forums here that allows for detailed layouts for each entry (e.g. if you wanted to add single images or an image gallery to an entry). You can view the code for all of that here: viewtopic.php?f=8&t=65736
Edit: Bug fixed!
Last edited by Kaji on Sun Dec 04, 2022 6:39 pm, edited 1 time in total.
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question.