How can I make a text box appear?

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
AHAKuo
Regular
Posts: 41
Joined: Tue Feb 06, 2018 11:10 am
Projects: SoUnd Is ToxIc
Organization: AHAKuo
Tumblr: ahakuo
Deviantart: ahakuo
Contact:

How can I make a text box appear?

#1 Post by AHAKuo »

Hey there! :) I wanted to know how can I make a text box show up? Like when you hit quit and the game asks for confirmation.

I wanted a box to pop up to give a tip. Like a hint system would.

And how can I make that box have a yes/no option?
Working on:

Image

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How can I make a text box appear?

#2 Post by Per K Grok »

AHAKuo wrote: Sun Jul 22, 2018 11:18 am Hey there! :) I wanted to know how can I make a text box show up? Like when you hit quit and the game asks for confirmation.

I wanted a box to pop up to give a tip. Like a hint system would.

And how can I make that box have a yes/no option?
You need to make a screen for the textbox.

It could be something like this.

Code: Select all

screen hint(Qtext):
    frame:
        padding (10,10)
        align (0.5, 0.5)
        vbox:
            text Qtext
            hbox:
                xalign 0.5
                textbutton "Yes" action Jump ("Somewhere")
                textbutton "No" action Jump ("SomewhereElse")

You can then show the textbox with

show screen hint("Some hint-text you want")

The textbox will now show up with the text you have entered and the options Yes and No.

You close the box with

hide screen hint

---

Read up on screens, frame, vbox and hbox to make a better looking box. :)

Post Reply

Who is online

Users browsing this forum: No registered users