Having trouble with text position...

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
riribelle
Newbie
Posts: 9
Joined: Wed May 27, 2015 5:32 pm
Completed: The Summer Princess and The Winter Princess
Projects: Dreamchasers: Aphelion, Blossoming ❀ Love
Organization: Krispy Cat, Tiara Change Me Games
Tumblr: starryflan
Deviantart: riribelle
Skype: riynashay
Location: Not here, there
Contact:

Having trouble with text position...

#1 Post by riribelle »

Hi there, newbie here! I was actually hoping I wouldn't have to ask for help, but I hit a wall and now I'm stuck. :'D

So here's the sitch. I've been trying to get my textbox aligned properly and I've ALMOST got it! Here's what's happening.

I'm using the one window variant (because two window refused to cooperate) like so:

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(who, what, side_image=None, two_window=False):

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

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

            has vbox:
                style "say_vbox"

            if who:
                text who id "who" xoffset 55
                spacing 10

            text what id "what" 
I've also got settings on my options.rpy like so:

Code: Select all

 #########################################
    ## These settings let you customize the window containing the
    ## dialogue and narration, by replacing it with an image.

    ## The background of the window. In a Frame, the two numbers
    ## are the size of the left/right and top/bottom borders,
    ## respectively.

    style.window.background = Frame("Misc/Frame.png", 20, 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 = 10
    style.window.bottom_margin = 0
    
    style.say_window.left_padding = 25 # This will adjust the x positioning of the text
    style.say_window.right_padding = 10
    style.say_window.top_padding = 10 # This will adjust the y positioning of the text

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

    style.window.left_padding = 20
    style.window.right_padding = 15
    style.window.top_padding = 50
    style.window.bottom_padding = 6

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

    style.window.yminimum = 155
Which means for my spoken dialogue looks like:

Image

...and thats great! That's exactly how I want it to look. Yay!

Except...

Image

...that's the opposite of great. I was trying to use the two window but the name just kind of. Floated way above the text box and refused to come down like so.

Help? ;__;

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Having trouble with text position...

#2 Post by trooper6 »

So...I'm pretty sure the real way to do this is to use the two window variant.
However, here is the quick way I thought of...
I imagine you have something like this right?

Code: Select all

define a = Character('Ayla', color="#c8ffc8")
label start:
    a "Do I have something on my face?"
    "I laugh a little just to show her I'm not upset. But she keeps staring."
You are using the default narrator character. Why don't you just create a narrator character by hand with blank space for a name:

Code: Select all

define a = Character('Ayla', color="#c8ffc8")
define n = Character('     ', color="#c8ffc8")
label start:
    a "Do I have something on my face?"
    n "I laugh a little just to show her I'm not upset. But she keeps staring."
This should do what you want...though I still think the two window option is probably the real way to do.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
riribelle
Newbie
Posts: 9
Joined: Wed May 27, 2015 5:32 pm
Completed: The Summer Princess and The Winter Princess
Projects: Dreamchasers: Aphelion, Blossoming ❀ Love
Organization: Krispy Cat, Tiara Change Me Games
Tumblr: starryflan
Deviantart: riribelle
Skype: riynashay
Location: Not here, there
Contact:

Re: Having trouble with text position...

#3 Post by riribelle »

I ended up defining a blank character because otherwise I couldn't get the ctc to work...

Here's what happens when I use Say Two Window:

Code: Select all

 #########################################
    ## These settings let you customize the window containing the
    ## dialogue and narration, by replacing it with an image.

    ## The background of the window. In a Frame, the two numbers
    ## are the size of the left/right and top/bottom borders,
    ## respectively.

    style.window.background = Frame("Misc/Frame.png", 20, 0)
    style.say_who_window.background = Frame("Misc/Frame2.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 = 10
    style.window.bottom_margin = 0
    
    style.say_window.left_padding = 25 # This will adjust the x positioning of the text
    style.say_window.right_padding = 10
    style.say_window.top_padding = 50 # This will adjust the y positioning of the text

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

    style.window.left_padding = 20
    style.window.right_padding = 15
    style.window.top_padding = 50
    style.window.bottom_padding = 6

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

    style.window.yminimum = 155
Frame2.png is just a blank file, I don't want a floating textbox.

That creates this:

Image

Now I can bring it down with the spacing coding...

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(who, what, side_image=None, two_window=True):

    # Decide if we want to use the one-window or two-window variant.
    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"
            spacing -20
                        
            if who:
                window:
                    style "say_who_window"
                    
                    text who:
                        id "who" xoffset 55
                        

            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
Which brings it down farther, like so...

Image

Except when I change the spacing variable (ex from the -20 listed, I changed it to -30)...

Image

Which begs the question of how to fix that, ahahaha. Is there a magic coding trick to solve that so it doesnt go behind the text box...?

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Having trouble with text position...

#4 Post by trooper6 »

riribelle wrote: Which begs the question of how to fix that, ahahaha. Is there a magic coding trick to solve that so it doesnt go behind the text box...?
I do recall people talking about just this issue in the message boards before. Let me see if I can find one of the threads.

Yep...here it is: http://lemmasoft.renai.us/forums/viewto ... se#p309221
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
riribelle
Newbie
Posts: 9
Joined: Wed May 27, 2015 5:32 pm
Completed: The Summer Princess and The Winter Princess
Projects: Dreamchasers: Aphelion, Blossoming ❀ Love
Organization: Krispy Cat, Tiara Change Me Games
Tumblr: starryflan
Deviantart: riribelle
Skype: riynashay
Location: Not here, there
Contact:

Re: Having trouble with text position...

#5 Post by riribelle »

Omigosh, THANK YOU! It was driving me up the wall, I was afraid I'd never find the fix!

Post Reply

Who is online

Users browsing this forum: bloodzy, Google [Bot]