History Text Misaligned After Adding Scrollbar

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
amaturemanga
Regular
Posts: 97
Joined: Sun Mar 08, 2015 6:55 pm
Deviantart: amaturemanga
Skype: amature.manga
Contact:

History Text Misaligned After Adding Scrollbar

#1 Post by amaturemanga »

Hi there, i was making a custom History screen and it was working fine. But then i added the scrollbar and now everything is misaligned in fact the name is on the wrong line the name in the image is supposed to be inside the red square i drew. Here is my screen and gui code and help would be appreciated.

Screen.rpy

Code: Select all

screen history():

    tag menu

    add "gui/Backlog_Background.png"
    textbutton "Return" action Return() xalign 0.03 yalign 0.90

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

    hbox:
        text "Backlog" size 35
        xalign 0.03 yalign 0.05


    hbox:
        add "gui/Backlog_Background_Border.png"
        xalign 0.03 yalign 0.07

    vpgrid:
        style_prefix "history"

        cols 1
        yinitial 1.0

        mousewheel True
        draggable True
        scrollbars "vertical"

        side_ysize 552
        side_xsize 940
        side_xpos 300
        side_ypos 120

        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"

                        ## 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

        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
gui.rpy

Code: Select all

## History #####################################################################
##
## The history screen displays dialogue that the player has already dismissed.

## The number of blocks of dialogue history Ren'Py will keep.
define config.history_length = 250

## The height of a history screen entry, or None to make the height variable at
## the cost of performance.
define gui.history_height = 160

## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.history_name_xpos = 155
define gui.history_name_ypos = 0
define gui.history_name_width = 155
define gui.history_name_xalign = 1.0

## The position, width, and alignment of the dialogue text.
define gui.history_text_xpos = 170
define gui.history_text_ypos = 82
define gui.history_text_width = 1100
define gui.history_text_xalign = 0.0
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]