screen 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
OmnyN
Newbie
Posts: 2
Joined: Tue Oct 10, 2017 1:37 pm
Contact:

screen History

#1 Post by OmnyN »

Hello. I've decided to change the default history menu. I have a problem and I can't solve it.
As you can see on the screenshot, text blocks are overlapping despite of using gui.history_height = None
I've written my own vpgrid for history screen:
https://pp.userapi.com/c837134/v8371343 ... UPMv6I.jpg

Code: Select all

gui.rpy
## История #####################################################################
define config.history_length = 150
define gui.history_height = 110
 

define gui.history_name_xpos = 200
define gui.history_name_ypos = 70
define gui.history_name_width = 200
define gui.history_name_xalign = 1.0
 

define gui.history_text_xpos = 225
define gui.history_text_ypos = 70
define gui.history_text_width = 1185
define gui.history_text_xalign = 0.0
 
################################################################################
################################################################################
 
screen history():
 
    tag menu
   
    frame:
        background "gui/history_back.png"
        xpos 260
   
    predict False
 
    vpgrid:
        style_prefix "history"
 
        scrollbars "vertical"
        mousewheel True
        draggable True
 
        cols 1
        yinitial 1.0
        side_ysize 900
        side_xsize 1400
        side_xpos 220
        side_ypos 120
 
        for h in _history_list:
 
            window:
                #background "#f002"
                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"]
 
 
                text h.what
 
        if not _history_list:
            label _("The dialogue history is empty.")
 
    button:
        idle_background "gui/button/return_btn_idle.png"
        hover_background "gui/button/return_btn_hover.png"
        focus_mask "gui/button/return_btn_hover.png"
        action Return()
        xpos 90
        ypos 870
 
style history_window is empty
 
style history_name is gui_label
## Взял шрифты от say_text вместо gui_text
style history_name_text is say_text
style history_text is gui_text
 

style history_text is say_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
Any ideas how to fix it?

OmnyN
Newbie
Posts: 2
Joined: Tue Oct 10, 2017 1:37 pm
Contact:

Re: screen History

#2 Post by OmnyN »

bump!

User avatar
Pinlin
Regular
Posts: 98
Joined: Fri Feb 08, 2013 9:33 am
Projects: Dark nights
Tumblr: darknightsblog
Deviantart: Pinlin
Contact:

Re: screen History

#3 Post by Pinlin »

Hello, I've been messing around with your code and discovered that this part:

Code: Select all

define config.history_length = 150
define gui.history_height = 110
The height affects the blocks. Between 80-150 allowes 3 lines of dialogue/text and if more, text will overlap. Change the number to something higher like 200 or something.

Code: Select all

define gui.history_height = 200
The spacing affects all blocks, but allows you to add more lines. Another solution is using shorter sentences.
Deviantart | Tumblr

Current project:

Image

Post Reply

Who is online

Users browsing this forum: Google [Bot], simple_human