Text vertical alignment changes with character name [SOLVED]

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
Shades of Night
Regular
Posts: 35
Joined: Fri Feb 27, 2015 7:16 pm
Tumblr: serilyn
Deviantart: shadesofnight
Location: Bag of holding #396
Contact:

Text vertical alignment changes with character name [SOLVED]

#1 Post by Shades of Night » Thu Mar 19, 2015 4:22 am

The solution to this is probably really simple, but I just can't think of anything that doesn't involve going in circles.

I have one textbox for characters speaking which has a space for their name. I have another textbox for narration, obviously minus the space for the names. Previously these were lined up and working fine, the name was in the name space, text was in the text space... But then I changed the size of the name font (using 'style.say_label.size = 30' ). And now if I line up the name/speech perfectly, then the narration will be off. If I line up the narration perfectly, the name/speech will be off...

I'm using this in the options.rpy to line up the narration text:

Code: Select all

    style.window.left_padding = 287
    style.window.right_padding = 277
    style.window.top_padding = 560
    style.window.bottom_padding = 20
And I'm using this in screens.rpy to line up the name/speech text:

Code: Select all

screen say(who, what, side_image=None, two_window=False):

    if not two_window:

        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who" xpos -83 ypos -18 

            else:
                text " "

            text what id "what"
If I change the last line to 'text what id "what" xpos -0 ypos -10' then I come full circle, the name/speech text looks right but the narration is off again.

Is there some way I can get this working without having to revert the name back to a smaller font size?
Last edited by Shades of Night on Thu Mar 19, 2015 4:36 pm, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Text vertical alignment changes with character name.

#2 Post by philat » Thu Mar 19, 2015 8:55 am

Code: Select all

            if who:
                text who id "who" xpos -83 ypos -18 

            else:
                null height 28 ## adjust number

User avatar
Shades of Night
Regular
Posts: 35
Joined: Fri Feb 27, 2015 7:16 pm
Tumblr: serilyn
Deviantart: shadesofnight
Location: Bag of holding #396
Contact:

Re: Text vertical alignment changes with character name.

#3 Post by Shades of Night » Thu Mar 19, 2015 4:35 pm

Thank you! <3

Post Reply

Who is online

Users browsing this forum: Google [Bot], _ticlock_