Help aligning text box?

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
Mithrilda
Regular
Posts: 26
Joined: Mon Oct 13, 2014 2:01 pm
Contact:

Help aligning text box?

#1 Post by Mithrilda »

I'm trying to put these textboxes into my game and I'm a little confused. I have separate ones for the characters and the narrator, but they're not lining up. How do I realign the text box for the narrator? I think I read somewhere that it automatically takes the settings from the other text box? Sorry, I just couldn't find anything about this in the forums. I'm using this for the narrator:

Code: Select all

define narrator = Character(' ', window_background="text box no name.png")
Whenever I use this,

Code: Select all

define narrator = Character(' ', window_background=("text box no name.png", 28, 10))
it just goes back to the old text box.

Image


Image

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Help aligning text box?

#2 Post by gas »

Try with the window_ style definition at character declaration.

Code: Select all

define e = Character("MazinKaiser",window_xalign=0.5) # an x-aligned dialogue window
All other style properties are inherited.
I'm right?
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: Help aligning text box?

#3 Post by OokamiKasumi »

You can code two separate textboxes, or multiple textboxes. The trick is to first set up the Narrator's textbox --the one that isn't assigned to a specific character-- with its margins and padding codes in options.rpy, then Add the extra margins and padding needed for your characters' textboxes inside the individual Character's definitions.

The key to remember is that the padding & margins numbers within the character definitions will ADD to, or SUBTRACT from, the codes you set in options.rpy.

Example:

In script.rpy

Code: Select all

define gi = Character('Giselle',
    color="6699cc",
    show_who_window_style="say_who_windowPNK",
    
    window_left_margin = 6,
    window_right_margin = 6,
    window_top_margin = 6,
    window_bottom_margin = 6,
    
    window_left_padding = 6,
    window_right_padding = 6,
    window_top_padding = 6,
    window_bottom_padding = 6,

    show_two_window = True,
    ctc="ctc_blink",)

define a = Character('Arthur',
    color="9966cc",
    show_who_window_style="say_who_windowBLU",
    
    window_left_margin = 6,
    window_right_margin = 6,
    window_top_margin = 6,
    window_bottom_margin = 6,
    
    window_left_padding = 6,
    window_right_padding = 6,
    window_top_padding = 6,
    window_bottom_padding = 6,

    show_two_window = True,
    ctc="ctc_blink",)
Don't forget the commas at the end!

This is especially useful if you're using different textboxes for each character.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]