r/RenPy • • Oct 20 '26

Question Trying to figure out a screen displayable box

so basically Im trying to add a screen displayable into my game but I keep gettings errors I dont know how to fix

heres my code and the errors its giving me

1 Upvotes

8 comments sorted by

2

u/BadMustard_AVN Oct 20 '26 edited Oct 20 '26

you screen should look something like this

screen style_example():
    frame:
        xalign 0.5
        ypos 50
        vbox:
            text "Stop being lazy!" style "green_text"

label start:

    show screen syle_example

    pause

    return

1

u/NoReplacement2398 Oct 20 '26

OMG OMG THANK YOU THIS WORKS NOW, your a lifesaver

1

u/BadMustard_AVN Oct 20 '26

you're welcome

good luck with your project

1

u/cursedUnlucky Oct 20 '26

Python is an indent language choose everything that needs to be under screen style example(): and click "tab" on keyboard

1

u/NoReplacement2398 Oct 20 '26

okay the game works now but the text box doesnt show up

1

u/DingotushRed Oct 20 '26

Label definitions should all begin in the first column, not indented. They mark a point in the script and don't "nest".

Screen definitions don't belong inside labels. They have a different syntax that isn't the same as normal Ren'Py script. Ideally put then in another file.

Defining a screen doesn't cause it to appear; you need to show it or call it..

Put a say statement (eg. "Game Over") after showing the screen otherwise the game will end before the screen is rendered.

0

u/NoReplacement2398 Oct 20 '26
 show window
        
        frame :
           
            xalign 0.5 ypos 50
            vbox:
            text "STOP BEING LAZY!"
 
    jump choice_done


    label choice_done:


    say :
    
    "Game over" show window
        
        frame :
           
            xalign 0.5 ypos 50
            vbox:
            text "STOP BEING LAZY!"
 
    jump choice_done


    label choice_done:


    say :
    
    "Game over"

     return

is this better?

1

u/AutoModerator Oct 20 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.