Page 1 of 1

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

Posted: Tue Oct 09, 2018 8:44 am
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 :)

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

Posted: Tue Oct 09, 2018 10:46 am
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

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

Posted: Tue Oct 09, 2018 12:25 pm
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 :)