[SOLVED] Showing Multiple Lines of Text on Screen

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
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

[SOLVED] Showing Multiple Lines of Text on Screen

#1 Post by Westeford »

Right now I'm stuck trying to show text onscreen. It's like in Danganronpa during the trials when they show the truth bullets before a debate.

Code: Select all

if bullet_max == 3: #Defined earlier. 
        show text "{size=50}[bullet1]" onlayer screens #Want to show them one at a time instead of all at once.
        show text "{size=50}[bullet2]" onlayer screens
        show text "{size=50}[bullet3]" onlayer screens
So what I expected was for three lines of text to appear each showing a piece of evidence. Instead, the last line shows up and not the others.
I tried making the lines of text into images. For example

Code: Select all

define bullet1 = "Autopsy"
image bull_1 = "{size=50}[bullet1]"
This worked, but when I go to the second debate and say

Code: Select all

$ bullet1 = "Curtain"
The image wouldn't change unless I used define, which would mess up the first debate by giving me curtain instead of autopsy.

For reference here's what I'm talking about. They show the truth bullets at 5:13. Though normally they show more than one.
https://youtu.be/mkuaGnwcubs?t=313 (Still don't know how to show videos in post. lol)

Basically, I'm trying to show three separate lines of text without cancelling them out.
I appreciate any input. Thank you for taking the time to read this.
Last edited by Westeford on Wed Dec 05, 2018 10:42 pm, edited 1 time in total.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Showing Multiple Lines of Text on Screen

#2 Post by Remix »

show text "A" as t1
show text "B" as t2
show text "C" as t3
hide t2

Basically alias each using " as alias_name " so Ren'Py does not overwrite/reuse them.
Frameworks & Scriptlets:

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Showing Multiple Lines of Text on Screen

#3 Post by Remix »

I would though advise considering a screen instead...

Code: Select all

screen bullet_list( sentences=[] ):
    fixed:
        vbox:
            for sentence in sentences:
                text "[sentence]"

label start:
    show screen bullet_list( ["A", "B", "C" ] )
Fly-typed, might need tweaks...
Frameworks & Scriptlets:

User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Re: Showing Multiple Lines of Text on Screen

#4 Post by Westeford »

Remix wrote: Wed Dec 05, 2018 7:33 am show text "A" as t1
show text "B" as t2
show text "C" as t3
hide t2
Basically alias each using " as alias_name " so Ren'Py does not overwrite/reuse them.
Thank you so much, this was exactly what I needed. I'm using a screen for the whole thing, I just wanted to show the relevant code. But yeah, thank you.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]