Tell me how to highlight each phrase of history in its frame?

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
Andredron
Miko-Class Veteran
Posts: 718
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Tell me how to highlight each phrase of history in its frame?

#1 Post by Andredron »

In the new gui given such a screen code

Code: Select all

## https://www.renpy.org/doc/html/history.html

screen history():
    tag menu
    predict False
    use game_menu(_("История"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
        style_prefix "history"
        for h in _history_list:
            window:
                has fixed:
                    yfit True
                if h.who:
                    label h.who:
                        style "history_name"
                        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
        if not _history_list:
            label _("История диалогов пуста.")
            
            
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

But I can not figure out how to prescribe a frame for each phrase in it. Crutches do what you have? Where is every phrase - 1 variable set and the screen create with a bunch of conditions?

User avatar
Treladon
Regular
Posts: 40
Joined: Sat Dec 31, 2016 3:20 pm
Projects: ToMaG, Feinted Game
Organization: Kuehler-Corrada Productions
Deviantart: Journie
Contact:

Re: Tell me how to highlight each phrase of history in its frame?

#2 Post by Treladon »

Hi Andredron. I'm sorry, I'm having a little trouble understanding what you want, but I will try to answer.

If you want a frame around every line of dialogue in the history screen, just replace "window" with "frame." See below:

Code: Select all

screen history():
    tag menu
    predict False
    use game_menu(_("История"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
        style_prefix "history"
        for h in _history_list:
            frame: ###CHANGED WINDOW TO FRAME HERE###
                has fixed:
                    yfit True
                if h.who:
                    label h.who:
                        style "history_name"
                        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
        if not _history_list:
            label _("История диалогов пуста.")
Is this what you're looking for?
WIP: The Tasks of Messengers and Guardians - Progress Page Here!

User avatar
Andredron
Miko-Class Veteran
Posts: 718
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Tell me how to highlight each phrase of history in its frame?

#3 Post by Andredron »

Treladon wrote: Wed Feb 14, 2018 12:40 am Hi Andredron. I'm sorry, I'm having a little trouble understanding what you want, but I will try to answer.

If you want a frame around every line of dialogue in the history screen, just replace "window" with "frame." See below:

Code: Select all

screen history():
    tag menu
    predict False
    use game_menu(_("История"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
        style_prefix "history"
        for h in _history_list:
            frame: ###CHANGED WINDOW TO FRAME HERE###
                has fixed:
                    yfit True
                if h.who:
                    label h.who:
                        style "history_name"
                        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
        if not _history_list:
            label _("История диалогов пуста.")
Is this what you're looking for?
Forgive me for my awful English, but yes I wanted every phrase in the box. Thank you, your method came up to me.

User avatar
Treladon
Regular
Posts: 40
Joined: Sat Dec 31, 2016 3:20 pm
Projects: ToMaG, Feinted Game
Organization: Kuehler-Corrada Productions
Deviantart: Journie
Contact:

Re: Tell me how to highlight each phrase of history in its frame?

#4 Post by Treladon »

Andredron wrote: Wed Feb 14, 2018 3:23 pm Forgive me for my awful English, but yes I wanted every phrase in the box. Thank you, your method came up to me.
Oh, no, it's very good, much better than my knowledge of Russian haha! I'm glad it worked for you!
WIP: The Tasks of Messengers and Guardians - Progress Page Here!

Post Reply

Who is online

Users browsing this forum: barsunduk