Textbox Problems...

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
wakagana
Veteran
Posts: 374
Joined: Mon May 14, 2012 1:27 am
Projects: Flash Q
Organization: Team Bread
Contact:

Textbox Problems...

#1 Post by wakagana »



Code: Select all

# Say
#
# Screen that's used to display adv-mode dialogue.
# http://www.renpy.org/doc/html/screen_special.html#say
screen say:

    # Defaults for side_image and two_window
    default side_image = None
    default two_window = False

    # Decide if we want to use the one-window or two-window varaint.
    if not two_window:

        # The one window variant.        
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:            
                window:
                    style "say_who_window"

                    text who:
                        id "who"
                        
            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"
              
    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0

    # Use the quick menu.
    use quick_menu

Code: Select all

    style.window.background = Frame("Swag.png", 0, 0)

    ## Margin is space surrounding the window, where the background
    ## is not drawn. 

    style.window.left_margin = 0
    style.window.right_margin = 0
    style.window.top_margin = 0
    style.window.bottom_margin = 0

    ## Padding is space inside the window, where the background is
    ## drawn.

    style.window.left_padding = 20
    style.window.right_padding = 0
    style.window.top_padding = 20
    style.window.bottom_padding = 6

    ## This is the minimum height of the window, including the margins
    ## and padding.

    style.window.yminimum = 150
   

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Textbox Problems...

#2 Post by apricotorange »

You want show_two_window. See http://lemmasoft.renai.us/forums/viewto ... =51&t=9233 for more helpful tips.

User avatar
wakagana
Veteran
Posts: 374
Joined: Mon May 14, 2012 1:27 am
Projects: Flash Q
Organization: Team Bread
Contact:

Re: Textbox Problems...

#3 Post by wakagana »

I've been staring at that for the past 2 days and I haven't gotten much of anywhere :\

I'm really getting frustrated with this. I've already been smacking my head against the wall to try and learn this stuff with the guides on here and on the Ren'py site. but I just cant comprehend them.

I've figured out the text box staying the same size and I've fixed the alignment of my text,but I have no idea how to separate the characters from the text and set them into the box above. I can stare and re-read the guide 20 times but my mind just cant wrap around what the person who made that post is trying to say. Its literally just a wall of text to me that is rather vague. >.<

User avatar
Kuroneko_rg
Veteran
Posts: 294
Joined: Sat Oct 22, 2011 8:39 pm
Projects: Dark Pleasures, Kiss of Blood, Midnight Park
Organization: Black Cat Alleyway
Location: Yomi
Contact:

Re: Textbox Problems...

#4 Post by Kuroneko_rg »

Oh... that issue I remember... I solved it by definning an empty character like this:

Code: Select all

define n = Character('  ', show_two_window=True)
Then use that character for narration. It's not a proper solution, but is an easy trick to bypass this problem.

You can align the names by adding position properties to the "text id who"

Code: Select all

             text who:
                 id "who"  ypos 20 xpos 10 an else...
Hope it works.

User avatar
Cinnamoon
Regular
Posts: 100
Joined: Wed May 30, 2012 5:24 am
Projects: Crystal Aria ~Starlight (20%), かわいいなリズム (38%)
Organization: CoffeeCat
Location: France~ ^^
Contact:

Re: Textbox Problems...

#5 Post by Cinnamoon »

Ok. So, maybe I can help ! (I hope)
This is the code I use :

Code: Select all

define a = Character('Alexys', color="#6495ED", what_color="#FFFFFF", who_xpos=820, who_ypos=435, what_xpos=12, what_ypos=440, window_right_padding =12)
You can then choose wherever you want the name to pop out with who_xpos/ypos and the text and dialogs with what_xpos/ypos.
I hope this helped !

Oh, and beautiful voice by the way ^^

EDIT: Oh, and this code doesn't need show_two_window actually, so I don't know if this is what you want :/

User avatar
wakagana
Veteran
Posts: 374
Joined: Mon May 14, 2012 1:27 am
Projects: Flash Q
Organization: Team Bread
Contact:

Re: Textbox Problems...

#6 Post by wakagana »

Thank you both for your help. But it seems that neither of those work.

Cinnamoon's code would make the characters name faded out and would completely remove the text that would be under the character names

And Kuro it doesn't seem what you suggested worked either. >.<

User avatar
lein
Newbie
Posts: 13
Joined: Sat Jul 26, 2008 1:06 am
Contact:

Re: Textbox Problems...

#7 Post by lein »

I assume you're using a fixed image for your textbox background, looking from your code....
how about modifying the position of the window instead of the text then?

and also as apricotorange said, have you tried the show_two_window?
without using it, both the char name and the text will appear on the same area, causing the line of the narrator and the char text going up and down like in your vid.
especially when you have that kind of window bg, you may also want to use the say_who_window bg into none so it'll be transparent and you can adjust it into your textbox background.
My artworks on deviantART.
Now also opening commission! *shameless promotion mode on


I wish I could start off my own VN thread ASAP ._.

User avatar
Cinnamoon
Regular
Posts: 100
Joined: Wed May 30, 2012 5:24 am
Projects: Crystal Aria ~Starlight (20%), かわいいなリズム (38%)
Organization: CoffeeCat
Location: France~ ^^
Contact:

Re: Textbox Problems...

#8 Post by Cinnamoon »

Oh sorry. Actually, I didn't see that your textbox was a Frame :o that is why my code doesn't work for you ^^ I actually use full screen image for my textboxes, so that's why the code works for me and not for you.
I apologize !

GeneDNC
Veteran
Posts: 251
Joined: Fri May 13, 2011 6:38 am
Completed: Freezing v1.0
Contact:

Re: Textbox Problems...

#9 Post by GeneDNC »

Try the following:

Code: Select all

    ## Padding is space inside the window, where the background is
    ## drawn.

    style.say_dialogue.ypos = xxx
Where xxx = the distance in pixels from the top of the textbox image to the top of the text. You might also just have to check how that interacts with the style.window.top_padding though.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]