[Solved] Multiple Name Boxes (New GUI Interface)

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
vwxyang0707
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 12:08 am
Contact:

[Solved] Multiple Name Boxes (New GUI Interface)

#1 Post by vwxyang0707 » Thu Oct 26, 2017 12:26 am

So I've been trying to work out multiple name boxes, and I've been roaming the forum, although I've only seen answers for the Legacy Theme Interface.
Is there a way to use multiple name boxes in the New GUI Interface?
Last edited by vwxyang0707 on Fri Nov 03, 2017 12:48 am, edited 1 time in total.

User avatar
ISAWHIM
Veteran
Posts: 287
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: Multiple Name Boxes (New GUI Interface)

#2 Post by ISAWHIM » Thu Oct 26, 2017 4:38 pm

Such as displaying two individuals speaking side by side?

BOB SAYS / JOE SAYS
Hi / Hello

User avatar
vwxyang0707
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 12:08 am
Contact:

Re: Multiple Name Boxes (New GUI Interface)

#3 Post by vwxyang0707 » Thu Oct 26, 2017 7:44 pm

No, I want to change the textbox for a specific character. An example would be how a narrator needs a different textbox, one without a namebox.

User avatar
ISAWHIM
Veteran
Posts: 287
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: Multiple Name Boxes (New GUI Interface)

#4 Post by ISAWHIM » Thu Oct 26, 2017 11:36 pm

You define the character, which includes adding textbox styles.

Code: Select all

#Custom backgrounds
define bgtitle = Image("gui/textboxtitle.png", xalign=0.5, yalign=1.0)
define bgnar = Image("gui/textboxnar.png", xalign=0.5, yalign=1.0)
define bgyou = Image("gui/textboxyou.png", xalign=0.5, yalign=1.0)
define bgthink = Image("gui/textboxthink.png", xalign=0.5, yalign=1.0)

#TitleBox
define X = Character(what_color="#000000", what_size=70, what_xanchor=0.5, what_xpos=0.49, what_ypos=40, what_textalign=0.5, window_background=bgtitle, window_yalign=0.0)
#NarratorBox (Custom, not the default narrator)
define N = Character(what_font="DomCasual BT.ttf", what_color="#222222", what_justify=True, what_ypos=13, window_background=bgnar)
#You, thinking
define T = Character(what_font="arial.ttf", what_color="#778899", what_justify=True, what_italic=True, window_background=bgthink)
#You, talking
define Y = Character(what_font="comic.ttf", what_color="#113388", what_justify=True, window_background=bgyou)

#Specific characters
define A = Character("Amy", color="#4d2600", what_justify=True, what_font="comic.ttf", what_color="#332200")
define C = Character("Cindy", color="#336600", what_justify=True, what_font="comic.ttf", what_color="#223300")
define M = Character("Mandy", color="#990073", what_justify=True, what_font="comic.ttf", what_color="#550044")
define F = Character("Fred", color="#660000", what_justify=True, what_font="comic.ttf", what_color="#330000")
That was the long answer...

Short answer... Yes.

You can alter the shape, size, images, colors, text, fonts, etc... (Just have to figure-out what each components names are, and the appropriate values needed. Above are some that I often use.)

User avatar
vwxyang0707
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 12:08 am
Contact:

Re: Multiple Name Boxes (New GUI Interface)

#5 Post by vwxyang0707 » Fri Oct 27, 2017 2:16 am

Alright, thank you! I referenced your code and had to search around the forum a while, but I got my text boxes to work.
Regarding alterations, would it be possible to rotate a name with who_rotate=-15?
I've been fiddling around with rotations in script.rpy and I just can't get the hang of it.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1879
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Multiple Name Boxes (New GUI Interface)

#6 Post by Donmai » Fri Oct 27, 2017 5:31 pm

Create an ATL transform somewhere. Usually, I put all my transforms in a separate .rpy file.

Code: Select all

transform rotate_name:
    xanchor .0 yanchor 1.0
    transform_anchor True
    rotate -15.0
Then edit your say screen adding the transform to the name label window:

Code: Select all

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                at rotate_name # <<<<<<< Here you are calling that transform
                style "namebox"
                text who id "who"

        text what id "what"
This will give ALL the characters names the same rotation. Giving different rotations to different characters names may be a bit more complicated...
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Google [Bot]