Changing the size of say who window (name) in text history

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
DeletedUser160413

Changing the size of say who window (name) in text history

#1 Post by DeletedUser160413 »

Hi!
How do I change the size and font of the style.say_who _window (name box) in my text history without using an imagemap? I can change the font and size of the text box easily like this:

Code: Select all

style.readback_text.color = "#fff"
style.readback_text.size = 18
But there is no code for the name box...


And also, how do I customize the appearance of my dynamic character name (first player name & last player name) because it doesn't change at all, except if I write something inside the "", which ruins the code because that's the name that shows up instead of the custom player name.

Here is the code:

Code: Select all

    define player_first_name = Character ("", color="#FF4277", font="fonts/Garogier.otf")
    define player_last_name = ""
    define player_name = ""
    # Use [player_first_name], [player_last_name] and [player_name] when adding name to sentence.

label start: 
 "What's your full name?"

 # The phrase in the brackets is the text that the game will display to prompt 
 # the player to enter the name they've chosen.

 $ player_name = renpy.input("What's your full name?") or "Me" 
 # Check for no input in name is done here
 $ player_name = player_name.strip() 
 # It may interfere with the splitting code if it strips space chars mid-string, need to check on that. If it's a problem use .rstrip() instead.

 python:
     if " " in player_name:
         player_first_name,player_last_name = player_name.split(" ") # If no full name is provided (no space chars), the [player_first_name] and [player_last_name] will remain blank.

 # Now the other characters in the game can greet the player.
 "[player_first_name], don't forget to save your progress as you proceed."
Thank you.

DeletedUser160413

Re: Changing the size of say who window (name) in text histo

#2 Post by DeletedUser160413 »

Bumping this! Still need someone to help me xD

User avatar
Keinart
Regular
Posts: 133
Joined: Sun May 13, 2012 8:28 pm
Completed: One Thousand Lies
Projects: Lotus Reverie
Organization: Keinart Lobre
Tumblr: keinart
itch: keinart
Location: Spain
Contact:

Re: Changing the size of say who window (name) in text histo

#3 Post by Keinart »

I'm not sure but I think you can do it going to the screens.rpy and in the say screen write the style property you want below the "who" window. Something like this:

Code: Select all

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        size 30 #You can change the size if you add this line
                        font "Myfont.ttf" #You can change the font if you add this line
                        id "who"
I don't know about the second question tho, sorry :?

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Changing the size of say who window (name) in text histo

#4 Post by Unin »

What are you using for text history? delta's readback.rpy?

DeletedUser160413

Re: Changing the size of say who window (name) in text histo

#5 Post by DeletedUser160413 »

Unin wrote:What are you using for text history? delta's readback.rpy?
Yes, exactly.

DeletedUser160413

Re: Changing the size of say who window (name) in text histo

#6 Post by DeletedUser160413 »

Keinart wrote:I'm not sure but I think you can do it going to the screens.rpy and in the say screen write the style property you want below the "who" window. Something like this:

Code: Select all

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        size 30 #You can change the size if you add this line
                        font "Myfont.ttf" #You can change the font if you add this line
                        id "who"
I don't know about the second question tho, sorry :?
Thank you! I tried it but unfortunately it doesn't seem to work. Instead, the scrollbar thumb got enlarged :?

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Changing the size of say who window (name) in text histo

#7 Post by Unin »

hmm... was gonna copy and paste my implementation, but I prepend my character's names to their dialogue when the characters are defined, rather than having it displayed separately like the default character setup.

Not having a normal implementation in front of me, I would assume that the character names are prepend to the dialogue within readback.rpy within the definition of store_say (line 215 for me). you would probably have to modify ReadbackADVCharacter() and ReadbackNVLCharacter() to store the character's color, and then modify store_say() to accept that color, and properly tag preparse_say_for_store(who) with that color within new_line, before it's added to the buffer.

DeletedUser160413

Re: Changing the size of say who window (name) in text histo

#8 Post by DeletedUser160413 »

Unin wrote:hmm... was gonna copy and paste my implementation, but I prepend my character's names to their dialogue when the characters are defined, rather than having it displayed separately like the default character setup.

Not having a normal implementation in front of me, I would assume that the character names are prepend to the dialogue within readback.rpy within the definition of store_say (line 215 for me). you would probably have to modify ReadbackADVCharacter() and ReadbackNVLCharacter() to store the character's color, and then modify store_say() to accept that color, and properly tag preparse_say_for_store(who) with that color within new_line, before it's added to the buffer.
I see. Can you please copy and paste your implementation, just so I can see it? What I'm trying to do is reduce the size of the text. I realised that changing the font, size or the color when defining a character doesn't really affect the text history which is a little annoying. I don't know what to do to change these parts.

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Changing the size of say who window (name) in text histo

#9 Post by Unin »

I don't think my code will help you, as I don't preserve size or color in text history; I was merely pointing out that my understanding of how it works is different, as I don't show the character name as a label separately from character text in game. Here's one of my characters:

Code: Select all

define guard1 = Character(None, color="#FFA064", what_outlines = [(1, "#000000", 0, 0)], what_color="FFA064", what_prefix='【Soldier 1】 「', what_suffix='」', ctc = spinningCTC())
as you can see, his name is none (not "none", but non-existent). rather I display the name in-text with a prefix as "【Soldier 1】".

Now that I reread your post though, it seems you are primarily focused on size and font for the name. So long as you are content to modify all names, this is doable. look at around line 300 or so for

Code: Select all

 label line[0] # name
that is your who, so if you try placing:

Code: Select all

style.readback_label_text.size = 20
in your styles section for example, that will change the size of the character name.

DeletedUser160413

Re: Changing the size of say who window (name) in text histo

#10 Post by DeletedUser160413 »

Unin wrote:I don't think my code will help you, as I don't preserve size or color in text history; I was merely pointing out that my understanding of how it works is different, as I don't show the character name as a label separately from character text in game. Here's one of my characters:

Code: Select all

define guard1 = Character(None, color="#FFA064", what_outlines = [(1, "#000000", 0, 0)], what_color="FFA064", what_prefix='【Soldier 1】 「', what_suffix='」', ctc = spinningCTC())
as you can see, his name is none (not "none", but non-existent). rather I display the name in-text with a prefix as "【Soldier 1】".

Now that I reread your post though, it seems you are primarily focused on size and font for the name. So long as you are content to modify all names, this is doable. look at around line 300 or so for

Code: Select all

 label line[0] # name
that is your who, so if you try placing:

Code: Select all

style.readback_label_text.size = 20
in your styles section for example, that will change the size of the character name.
You are a 100% right :D Thank you so much!! ^^

DeletedUser160413

Re: Changing the size of say who window (name) in text histo

#11 Post by DeletedUser160413 »

Btw, how do I get the name to be exactly at the beginning of the text, like this?

Image

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Changing the size of say who window (name) in text histo

#12 Post by Unin »

I align my text to center from options.rpy, and that tends to interfere with placement within the readback screen. if I had to guess, I would say some variation of:

Code: Select all

style.readback_label.align = (0, 0)
style.readback_text.align = (0, 0)

Post Reply

Who is online

Users browsing this forum: No registered users