Creating a glossary page. Better way of doing it?

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.
Post Reply
Message
Author
User avatar
lsf22
Regular
Posts: 139
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Creating a glossary page. Better way of doing it?

#1 Post by lsf22 »

Renpy Version: 8.0.3

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.

example code:

Code: Select all

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()
I have attached an image example as well.
Attachments
Example of my glossary screen
Example of my glossary screen

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2397
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Creating a glossary page. Better way of doing it?

#2 Post by Ocelot »

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.
< < insert Rick Cook quote here > >

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Creating a glossary page. Better way of doing it?

#3 Post by Kaji »

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.

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Creating a glossary page. Better way of doing it?

#4 Post by bonnie_641 »

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. :wink:

User avatar
lsf22
Regular
Posts: 139
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Creating a glossary page. Better way of doing it?

#5 Post by lsf22 »

Thanks for the suggestions. I was able to create my own glossary.

Some of the inspiration came from the cutesy Atelier Series, specifically Atelier Sophie 1.
Attachments
Atelier Sophie example
Atelier Sophie example

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]