Fonts and spacing in the History menu [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
Maou Zenigame
Regular
Posts: 66
Joined: Thu Nov 09, 2017 3:09 am
Contact:

Fonts and spacing in the History menu [SOLVED]

#1 Post by Maou Zenigame »

I'm trying another go at customizing the History menu to the way I want it to be, and it's at least somewhat functional now.
history.png

But now I've hit a dead end regarding two issues:

One, I want to change the font and color of the speaker's name text in the window, as well as add an outline to it.

Two, the entries are too bunched together so I'd like to add a blank space in between each line of dialogue.

Can anyone out there help me out with this?


For reference, here's the code that I'm using in the screens menu:

Code: Select all

screen history():
    tag menu
    add "gui/History/pg_history.png"
    predict False

    side "c r":
        area (100, 100, 650, 400)
        
        viewport id "vp":
            scrollbars "vertical"
            draggable True
            mousewheel True
            arrowkeys True
            yinitial 1.0
            area (230, 70, 1800, 470)
            
            vbox:
                for h in _history_list:
                    if h.who:
                        label h.who:
                            style "history_name"
                            
                            ## Take the color of the who text from the Character, if
                            ## set.
                            if "color" in h.who_args:
                                text_color h.who_args["color"]
                    text h.what outlines [ (1, "#000000", 0, 0), (0, "#000000", 2, 2) ]


                if not _history_list:
                    label _("The dialogue history is empty.")

## This determines what tags are allowed to be displayed on the history screen.

define gui.history_allow_tags = set()


style history_window is empty

style history_name is gui_label
style history_name_text is gui_label_text
style history_text is gui_text

style history_text is gui_text

style history_label is gui_label
style history_label_text is gui_label_text

style history_window:
    xfill True
    ysize gui.history_height

style history_name:
    xpos gui.history_name_xpos
    xanchor gui.history_name_xalign
    ypos gui.history_name_ypos
    xsize gui.history_name_width

style history_name_text:
    min_width gui.history_name_width
    text_align gui.history_name_xalign

style history_text:
    xpos gui.history_text_xpos
    ypos gui.history_text_ypos
    xanchor gui.history_text_xalign
    xsize gui.history_text_width
    min_width gui.history_text_width
    text_align gui.history_text_xalign
    layout ("subtitle" if gui.history_text_xalign else "tex")

style history_label:
    xfill True

style history_label_text:
    xalign 0.5
Last edited by Maou Zenigame on Tue Jun 05, 2018 11:15 pm, edited 1 time in total.

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Fonts and spacing in the History menu

#2 Post by kivik »

One, I want to change the font and color of the speaker's name text in the window, as well as add an outline to it.
Add the changes in your style history_name_text block. These are the text properties you can use: https://www.renpy.org/doc/html/style_pr ... properties
Two, the entries are too bunched together so I'd like to add a blank space in between each line of dialogue.
Easiest way (I think) is to tweak this block of code:

Code: Select all

            vbox:
                for h in _history_list:
                    if h.who:
                        label h.who:
                            style "history_name"
                            
                            ## Take the color of the who text from the Character, if
                            ## set.
                            if "color" in h.who_args:
                                text_color h.who_args["color"]
                    frame background None bottom_margin 50: # add this line
                        text h.what outlines [ (1, "#000000", 0, 0), (0, "#000000", 2, 2) ]
I used bottom_margin 50, you can adjust this to whatever you want. Alternatively you can give your frame a style name and style it outside the screen - but if this is literally the only place you'll be using this frame to break up your history, it's probably not necessary.

Maou Zenigame
Regular
Posts: 66
Joined: Thu Nov 09, 2017 3:09 am
Contact:

Re: Fonts and spacing in the History menu [SOLVED]

#3 Post by Maou Zenigame »

Thanks!

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Fonts and spacing in the History menu [SOLVED]

#4 Post by TellerFarsight »

history_height in the "gui" file is what you're looking for adding space between the lines.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

Post Reply

Who is online

Users browsing this forum: Andredron, Majestic-12 [Bot]