[solved] I will have to jump to another label, but I wanted this text to stay on the 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
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

[solved] I will have to jump to another label, but I wanted this text to stay on the screen?

#1 Post by Nanahs »

So, there's a part of my game where there's a quiz.
The screen would be something like this:

Image

In the beggining of the game, I let the player choose their name with this code:

Code: Select all

define e = Character("[name]")

    $ name = renpy.input("What's your name?") 
    $ name = name.strip()

Where it's written "player's name" (in the picture), I wanted the name the player chose to show up like that.
But the problem is: during the quiz, I'll have to jump labels as they answer the questions (because I'll change the background, etc).

Is there a way I could keep the player's name there, even when I jump to another label? Without having to keep writing it again and again in the scrip for each label?
Because I'd have to do it MANY times during the game, and I'm afraid that at some point I may forget.

Then, only when the quiz ends, I'd put a code to make the name disappear.
It is possible?

Thank you, everyone who helps in this forum :)
Last edited by Nanahs on Tue Oct 09, 2018 5:34 pm, edited 1 time in total.

User avatar
Enchant00
Regular
Posts: 136
Joined: Tue Jan 12, 2016 1:17 am
Contact:

Re: I will have to jump to another label, but I wanted this text to stay on the screen?

#2 Post by Enchant00 »

What you can do is define a screen that shows the name. I'm not home but I think this should work:

Just paste it anywhere

Code: Select all

screen PlayerName:
    text "[name]" size 40 align (0.5, 0.9)
Then use this command when you want to show the name:

Code: Select all

show screen PlayerName
If you have problems just say. Size is font size and align is x and y pos :D

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: I will have to jump to another label, but I wanted this text to stay on the screen?

#3 Post by Nanahs »

Enchant00 wrote: Tue Oct 09, 2018 10:46 am What you can do is define a screen that shows the name. I'm not home but I think this should work:

Just paste it anywhere

Code: Select all

screen PlayerName:
    text "[name]" size 40 align (0.5, 0.9)
Then use this command when you want to show the name:

Code: Select all

show screen PlayerName
If you have problems just say. Size is font size and align is x and y pos :D
Oh, thank you so much! I'll try that :)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Kocker