Change Color of History Text [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
MrRogerSmith
Regular
Posts: 42
Joined: Fri Jan 21, 2022 8:58 pm
Projects: Leaving DNA
itch: impiousmonk
Contact:

Change Color of History Text [SOLVED]

#1 Post by MrRogerSmith »

My History screen is currently displaying black colored text per:

Code: Select all

define gui.interface_text_color = u'#000000'
I want to change the history text color to #ffffff. How do I change the history text color without changing the gui interface text color? I believe I am using the default coding for the History screen:

Code: Select all

screen history():

    tag menu

    ## Avoid predicting this screen, as it can be very large.
    predict False

    use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):

        style_prefix "history"

        for h in _history_list:

            window:

                ## This lays things out properly if history_height is None.
                has fixed:
                    yfit True

                if h.who:

                    label h.who:
                        style "history_name"
                        substitute False

                        ## Take the color of the who text from the Character, if
                        ## set.
                        if "color" in h.who_args:
                            text_color h.who_args["color"]

                $ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
                text what:
                    substitute False

        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 = { "alt", "noalt" }


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 MrRogerSmith on Thu Mar 21, 2024 9:03 pm, edited 1 time in total.

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Change Color of History Text

#2 Post by m_from_space »

MrRogerSmith wrote: Wed Mar 20, 2024 1:09 pm I want to change the history text color to #ffffff. How do I change the history text color without changing the gui interface text color?
Just insert it here:

Code: Select all

style history_text:
    color "#ffffff"
    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")

MrRogerSmith
Regular
Posts: 42
Joined: Fri Jan 21, 2022 8:58 pm
Projects: Leaving DNA
itch: impiousmonk
Contact:

Re: Change Color of History Text

#3 Post by MrRogerSmith »

m_from_space wrote: Wed Mar 20, 2024 3:34 pm
MrRogerSmith wrote: Wed Mar 20, 2024 1:09 pm I want to change the history text color to #ffffff. How do I change the history text color without changing the gui interface text color?
Just insert it here:

Code: Select all

style history_text:
    color "#ffffff"
    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")
Thank you!

Post Reply

Who is online

Users browsing this forum: GetOutOfMyLab