Showing text at a bunch of different positions

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
parttimestorier
Regular
Posts: 175
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Showing text at a bunch of different positions

#1 Post by parttimestorier » Sun Jul 08, 2018 3:39 pm

I'm still a beginner at Ren'Py, thanks in advance to anyone who can help me figure this out!

There's a part in a project I'm working on where I want a bunch of different lines of text to pop up at different parts of the screen. Here's a quick mockup of what I'm trying to accomplish:
example.png
example.png (2.72 KiB) Viewed 168 times
I want each line to appear individually, and then stay on the screen so that once all of them have appeared they look a little like that.

Initially, I thought about just making each line of text a separate image, since positioning images is easy. But that wouldn't really be ideal, because I think it's best if it still acts like normal text - then the reader can change the speed, or skip through it, or do whatever else they can normally do to control stuff in the textbox. So what would be easiest way for me to have all the different lines of text appear in different places like that?
ImageImageImage

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1913
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Showing text at a bunch of different positions

#2 Post by Imperf3kt » Sun Jul 08, 2018 8:21 pm

You could make a text displayable and just show it at that position.
Example:

Code: Select all

image text_one = text("some words here")

label start:
    show text_one at center

I'm not entirely sure if thats the correct syntax for a text displayable, I'll have to check the documentation to be sure.


Here's the official documentation with examples:
https://www.renpy.org/doc/html/text.htm ... splayables
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
parttimestorier
Regular
Posts: 175
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Re: Showing text at a bunch of different positions

#3 Post by parttimestorier » Sun Jul 08, 2018 11:17 pm

Perfect, thanks!
ImageImageImage

User avatar
parttimestorier
Regular
Posts: 175
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Re: Showing text at a bunch of different positions

#4 Post by parttimestorier » Mon Jul 09, 2018 3:43 pm

Okay, I followed the documentation and now my code looks a bit like this:

Code: Select all

show text "Blah blah blah." at textposition1
    
pause
    
show text "Words words words." at textposition2
    
pause
Unfortunately, each time it shows a new line, it seems to automatically hide the previous line, even though I didn't tell it to. Does anyone know a way to make all the lines continue to layer onto the screen all together until I tell it to hide them?
ImageImageImage

User avatar
Remix
Miko-Class Veteran
Posts: 993
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 text at a bunch of different positions

#5 Post by Remix » Mon Jul 09, 2018 4:03 pm

Untested, though should be right:

show text "Blah blah." as text_1 at position_1
show text "Blah blah." as text_2 at position_2

Using " as text_1 " and " as something_else " should tell Ren'Py not to reuse an existing displayable.
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Finish Catmull-Rom Spline pathing
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1913
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Showing text at a bunch of different positions

#6 Post by Imperf3kt » Mon Jul 09, 2018 5:21 pm

Remix wrote:
Mon Jul 09, 2018 4:03 pm
Untested, though should be right:

show text "Blah blah." as text_1 at position_1
show text "Blah blah." as text_2 at position_2

Using " as text_1 " and " as something_else " should tell Ren'Py not to reuse an existing displayable.
Was also going to suggest this.
You'll probably need to define text_01 still.
You should also need to hide text_01, opposed to hide text
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
parttimestorier
Regular
Posts: 175
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Re: Showing text at a bunch of different positions

#7 Post by parttimestorier » Mon Jul 09, 2018 10:36 pm

That works perfectly, thanks to both of you!
ImageImageImage

Post Reply

Who is online

Users browsing this forum: No registered users