The Buttons Still Do Not Show Up!

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
writinggg
Regular
Posts: 47
Joined: Sun Oct 19, 2014 4:04 am
Contact:

The Buttons Still Do Not Show Up!

#1 Post by writinggg »

I am having a problem with a screen; the buttons refuse show up, even though my code says that they should be seen until they are pushed :

Code: Select all

screen beginning_gt :
    
    frame xalign 0.5 yalign 0.5 :
        has vbox
        
        hbox :
            text "What's Your Gender? "
            
            
            
        hbox :
            
           if cre_screen_g_pick == "False" :
            textbutton "Female" action [ SetVariable('play_gender', 'female') , SetVariable('cre_screen_g_pick', 'True')  ]
                        
            textbutton "Male" action [ SetVariable('play_gender', 'male') , SetVariable('cre_screen_g_pick', 'True') ]        
    
    
        hbox  :
            text "What Is Your Style Of Speech?"
            
            
        hbox :
            
            textbutton "Proper English"
                        
            textbutton "Regular"   
            
            textbutton "Slightly Slang"
            
            textbutton "All Yo!"
    

Code: Select all

label start:
    
    $ play_gender = "___"
    
    $ cre_screen_g_pick = False
Attachments
screenshot0001.png

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: The Buttons Still Do Not Show Up!

#2 Post by xela »

... indents? Bad coding manners? :D

Code: Select all

screen beginning_gt:
    frame align(0.5, 0.5):
        has vbox spacing 5
        text "What's Your Gender?"
        hbox:
           if not cre_screen_g_pick:
                textbutton "Female" action [SetVariable('play_gender', 'female') , SetVariable('cre_screen_g_pick', 'True')]
                textbutton "Male" action [SetVariable('play_gender', 'male') , SetVariable('cre_screen_g_pick', 'True')]
                
        text "What Is Your Style Of Speech?"
        hbox:
            textbutton "Proper English"       
            textbutton "Regular"
            textbutton "Slightly Slang"
            textbutton "All Yo!"

label start:
    $ play_gender = None
    $ cre_screen_g_pick = False
    call screen beginning_gt
Like what we're doing? Support us at:
Image

User avatar
Alex
Lemma-Class Veteran
Posts: 3093
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: The Buttons Still Do Not Show Up!

#3 Post by Alex »

Code: Select all

if cre_screen_g_pick == "False" :
the quotes - you don't need them here.

writinggg
Regular
Posts: 47
Joined: Sun Oct 19, 2014 4:04 am
Contact:

Re: The Buttons Still Do Not Show Up!

#4 Post by writinggg »

Thank you Xela and Alex :

The quotes were the cause of my original problem, and Xela's code changes helped me fix another problem I was having (it involved getting the game to say the variable in the screens's text after it was picked!)! :D

Post Reply

Who is online

Users browsing this forum: Google [Bot], henne