How to make introduction text?

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

How to make introduction text?

#1 Post by henvu50 »

When you click start new game, I want the following to happen:

1. black screen.
2. text fades in centered

"Welcome to the game."

3. wait for player to left click
4. previous text stays on screen
5. fade in new text slightly below previous text

"Welcome to the game."
"There are many interesting things about this game."

6. wait for player to left click
7. fade in new text below previous text

"Welcome to the game."
"There are many interesting things about this game."
"This is more text fading in, below the other text."

Here is my existing code:

Code: Select all

	pause 1.0

	show text "Welcome." with dissolve

	# wait for player to left click
	pause 999.0

	show text "This text erases this previous text, that's not what I want. I want this text to display below the Welcome text." with dissolve

	# wait for player to left click
	pause 999.0
    
	show text "This text erases this previous text, that's not what I want. I want this text to display below the Welcome text." with dissolve

	# wait for player to left click
	pause 999.0
The problem with the above code is if I left click once, it skips all the text.

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How to make introduction text?

#2 Post by henvu50 »

If you want to pause and wait until the player left clicks, just use pause without a duration

Code: Select all

show text "Welcome."
# wait for user to left click
pause

# *user left clicks*, but show text won't be skipped because we're using pause without a duration specified

show text "This text won't be skipped."
# wait for user to left click
pause

Now I just need to figure out how to get the text to stay on the screen instead of replacing the previous text.

User avatar
Andredron
Miko-Class Veteran
Posts: 718
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: How to make introduction text?

#3 Post by Andredron »

show text "text1 {w} \nText2" with dissolve

Text tag in launcher renpy, in tytorial

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How to make introduction text?

#4 Post by henvu50 »

I made each line of text a screen, so then I just show the screens.

Code: Select all


screen cust_intro_text1:

    # yalight .4
    text "Welcome." xalign 0.5 yalign 0.4

screen cust_intro_text2:

    # yalight .5
    text "Hello, more information here." xalign 0.5 yalign 0.5 

Code: Select all


    show screen cust_intro_text1
    pause

    show screen cust_intro_text2
    pause

    hide screen cust_intro_text1
    hide screen cust_intro_text2

The only problem now is I can't apply dissolve or fade to the show screen transitions. *sigh*

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How to make introduction text?

#5 Post by henvu50 »

Andredron wrote: Tue Sep 04, 2018 10:14 am show text "text1 {w} \nText2" with dissolve

Text tag in launcher renpy, in tytorial
That shows text1 & Text2 at the same time.

I want to show Text1 with a fade then wait for user left click. Then after they left click, it fades in Text 2 below Text1.

i've figured out most of it already, except I don't know how to get the show screen to apply a transition like dissolve or fade.

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How to make introduction text?

#6 Post by henvu50 »

Okay here is the complete code on how to show introduction text in a clean manner with fading, enjoy.

Code: Select all


screen cust_intro_text1:
    text "Welcome." xalign 0.5 yalign 0.4 at fade_screen

screen cust_intro_text2:
    text "Hello, more information here." xalign 0.5 yalign 0.5 at fade_screen

transform fade_screen:
    on show:
        alpha 0.0
        linear 1.0 alpha 1.0
    on hide:
        linear 0.5 alpha 0.0

label start:

    show screen cust_intro_text1
    pause

    show screen cust_intro_text2
    pause

    hide screen cust_intro_text1
    hide screen cust_intro_text2


User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: How to make introduction text?

#7 Post by IrinaLazareva »

another example..

Code: Select all

image textv1 = ParameterizedText(xalign=0.5, yalign=0.4)
image textv2 = ParameterizedText(xalign=0.5, yalign=0.5)
image textv3 = ParameterizedText(xalign=0.5, yalign=0.6)
    
label start:
    scene black 
    pause 1.0
    show textv1 "Welcome." with dissolve
    pause
    show textv2 "There are many interesting things about this game." with dissolve
    pause
    show textv3 "This is more text fading in, below the other text." with dissolve 
    pause
    scene black with dissolve
https://renpy.org/doc/html/text.html#ParameterizedText

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How to make introduction text?

#8 Post by henvu50 »

IrinaLazareva wrote: Tue Sep 04, 2018 11:03 am another example..

Code: Select all

image textv1 = ParameterizedText(xalign=0.5, yalign=0.4)
image textv2 = ParameterizedText(xalign=0.5, yalign=0.5)
image textv3 = ParameterizedText(xalign=0.5, yalign=0.6)
    
label start:
    scene black 
    pause 1.0
    show textv1 "Welcome." with dissolve
    pause
    show textv2 "There are many interesting things about this game." with dissolve
    pause
    show textv3 "This is more text fading in, below the other text." with dissolve 
    pause
    scene black with dissolve
https://renpy.org/doc/html/text.html#ParameterizedText
This is a lot more efficient, thank you.

Post Reply

Who is online

Users browsing this forum: babayi0827, Majestic-12 [Bot], Semrush [Bot]