Trying to customize the namebox position, three variants.

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
themocaw
Regular
Posts: 106
Joined: Mon Aug 06, 2007 10:58 am
Contact:

Trying to customize the namebox position, three variants.

#1 Post by themocaw »

What I am doing:
Using the two-box "say" system to have a separate window for the character name above the text box.

What I want to do:

Move the "name" box to left, right, or center depending on the character's position on the screen.

EXAMPLE
Beefcake
"As the beefcake I'm standing on the left."
Bishonen
"As the bishonen, I'm standing on the right."
Waifu
"And the Waifu is standing in the center."
-----
Any thoughts on how I could make this work? I tried using the method detailed here: http://renpyhandbook.tumblr.com/post/88 ... characters but I kept ending up with "who_window_style is undefined" errors.

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Trying to customize the namebox position, three variants

#2 Post by Milkymalk »

If you post your code for this, more people will look at it ;-)
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Re: Trying to customize the namebox position, three variants

#3 Post by Tayruu »

I had problems trying to just get text in the dialogue window to be aligned differently at all for a while, especially with different Characters. What I found was it was something to do with the style of say_window, followed by a different style for certain cases, though I'm not sure what specifically...

Checking that link it's possible the code is slightly out of date, I have a Character that uses what_style="dtitle", window_style="dwindow", so conversely maybe you need to specify who_style="" and refer to the style you want to use. I haven't altered the say screen though, like that asks.

User avatar
Kia
Eileen-Class Veteran
Posts: 1037
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Trying to customize the namebox position, three variants

#4 Post by Kia »

I did this a while ago and some time after that I found another way to do the same. lemme share the code and see if you can use it.
first way: (keep in mind I did this just when I started with renpy so it's messy)
in options

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("items/ghab.png", 25, 25)
    style.button.background = Frame("items/men.png", 25, 25)
    ## Margin is space surrounding the window, where the background
    ## is not drawn.

    style.window.left_margin = 30
    style.window.right_margin = 30
    # style.window.top_margin = 6
    style.window.bottom_margin = 5

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

    style.window.left_padding = 10
    style.window.right_padding = 10
    style.window.top_padding = 10
    style.window.bottom_padding = 10
    style.window.xfill=False
    #style.window.xpos = 1.0
    style.window.xalign = 0.0
    
    ## This is the minimum height of the window, including the margins
    ## and padding.
       
    style.window.yminimum = 30
    
    
    style.say_who_window.background = None
    style.say_who_window.bottom_margin = -25
    style.say_label.outlines=[(3, "#000055", 0, 0)]
    style.say_who_window.xfill=True
    
    #style.say_who_window.xfill = False
characters

Code: Select all

define narrator = Character(None,what_text_align=0.5,window_xalign=0.5,window_yalign=0.5, what_outlines=[(3, "#000000", 2, 2), (3, "#777777", 0, 0)], what_color="#ffffff")
define gen = Character('Gen', show_two_window=True, window_background=Frame("items/frmgen.png", 10, 10),color="#0066ff",what_color="#ffffff")
define lol = Character('Lola',show_two_window=True,window_xalign=1.0,who_xalign=1.0,window_background=Frame("items/frmlol.png", 10, 10), color="#ffff00", what_color="#000000")
style.say_who_window.xfill=True is the line that makes it possible if I recall correctly

and the other way is: http://lemmasoft.renai.us/forums/viewto ... 32&t=28567

Post Reply

Who is online

Users browsing this forum: Google [Bot], PrxnceKxsses