Changing textbox height of History (etc) page? [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
ourdecemberdreams
Regular
Posts: 58
Joined: Sat Apr 15, 2017 3:26 pm
Projects: The Last December
Tumblr: ourdecemberdreams
Deviantart: ourdecemberdreams
itch: ourdecemberdreams
Contact:

Changing textbox height of History (etc) page? [SOLVED]

#1 Post by ourdecemberdreams » Thu May 11, 2017 4:30 am

I have this problem for my History, Credits and Preference page!
I want my page to look like this:
Image

But I can't figure out how to make the textbox smaller and move it down, so now it's covering my title:
Image

I've been trying to figure this out for a week! I couldn't find anything online that I could understand, can someone please tell me how to solve this? :(
Also, if possible, is there a way to underline all my character names in the History page?
Last edited by ourdecemberdreams on Sun Jun 18, 2017 9:53 pm, edited 1 time in total.

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#2 Post by Scribbles » Thu May 11, 2017 8:10 am

are you using the new GUI? have you tried adjusting the values for History in gui.rpy ?
Image - Image -Image

ourdecemberdreams
Regular
Posts: 58
Joined: Sat Apr 15, 2017 3:26 pm
Projects: The Last December
Tumblr: ourdecemberdreams
Deviantart: ourdecemberdreams
itch: ourdecemberdreams
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#3 Post by ourdecemberdreams » Thu May 11, 2017 8:33 am

Scribbles wrote:are you using the new GUI? have you tried adjusting the values for History in gui.rpy ?
What do you mean the new GUI?
If you mean the newest update for renpy, yup, I just checked, it is the latest version
And yes, I've tried adjusting every single value under the History page in gui.rpy :(

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#4 Post by Scribbles » Thu May 11, 2017 9:29 am

ourdecemberdreams wrote:
Scribbles wrote:are you using the new GUI? have you tried adjusting the values for History in gui.rpy ?
What do you mean the new GUI?
If you mean the newest update for renpy, yup, I just checked, it is the latest version
And yes, I've tried adjusting every single value under the History page in gui.rpy :(
when you create a game it gives you the options to use "legacy" (the old one) or the new GUI (something along those lines)

I had to toy around with these values with my game.

I think you'll want to adjust "define gui.history_height" for what you're going for?

I had to leave the game open on the history screen and constantly shift + R as I adjusted the values lol

if none of that works you can try to create your own history screen with a frame at the dimensions you want. I'm not super knowledgeable about code, but that might help?
Image - Image -Image

ourdecemberdreams
Regular
Posts: 58
Joined: Sat Apr 15, 2017 3:26 pm
Projects: The Last December
Tumblr: ourdecemberdreams
Deviantart: ourdecemberdreams
itch: ourdecemberdreams
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#5 Post by ourdecemberdreams » Thu May 11, 2017 10:15 am

Scribbles wrote:when you create a game it gives you the options to use "legacy" (the old one) or the new GUI (something along those lines)

I had to toy around with these values with my game.

I think you'll want to adjust "define gui.history_height" for what you're going for?

I had to leave the game open on the history screen and constantly shift + R as I adjusted the values lol

if none of that works you can try to create your own history screen with a frame at the dimensions you want. I'm not super knowledgeable about code, but that might help?
Oh, I'm not too sure about that
I tried the Change/Update GUI button under the navigate script option, but it only asked me to change the colours, I'm not too sure what I chose at the start ><
Nope, the "define gui.history_height" changes the individual height of each line of text in the History page instead of the entire scrollable text box

Would you happen to know how I can create my own frame?

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#6 Post by Scribbles » Thu May 11, 2017 10:21 am

Oh, I'm not too sure about that
I tried the Change/Update GUI button under the navigate script option, but it only asked me to change the colours, I'm not too sure what I chose at the start ><
Nope, the "define gui.history_height" changes the individual height of each line of text in the History page instead of the entire scrollable text box

Would you happen to know how I can create my own frame?
sounds like you're using the new gui, as for creating a frame check out the documentation:

https://www.renpy.org/doc/html/screens.html#frame

reading through the screens doc might help you.
Image - Image -Image

ourdecemberdreams
Regular
Posts: 58
Joined: Sat Apr 15, 2017 3:26 pm
Projects: The Last December
Tumblr: ourdecemberdreams
Deviantart: ourdecemberdreams
itch: ourdecemberdreams
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#7 Post by ourdecemberdreams » Thu May 11, 2017 1:00 pm

Hi guys, I still need help
I tried creating a new frame, and I tried adding a ysize to the History page, but where should I exactly add it in?
It will either give me error, or the page will look weird

Code: Select all

screen history():

    tag menu

    ## Avoid predicting this screen, as it can be very large.
    predict False
    hbox:
        ysize 300
        use game_menu(_(""), scroll=("vpgrid" if gui.history_height else "viewport2")):
            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"

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

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

    add "gui/history_img.png":
        xalign 0.5
        yalign 0.2
this code will give me this:
Image

Code: Select all

screen history():

    tag menu

    ## Avoid predicting this screen, as it can be very large.
    predict False
    
    use game_menu(_(""), scroll=("vpgrid" if gui.history_height else "viewport2")):
        style_prefix "history"
        hbox:
            ysize 300
            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"]

                    text h.what

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

    add "gui/history_img.png":
        xalign 0.5
        yalign 0.2
this code gives me this, just one line and empty spaces below:
Image

Code: Select all

screen history():

    tag menu

    ## Avoid predicting this screen, as it can be very large.
    predict False
    
    use game_menu(_(""), scroll=("vpgrid" if gui.history_height else "viewport2")):
        style_prefix "history"
    
        for h in _history_list:
            hbox:
                ysize 300
                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"]

                    text h.what

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

    add "gui/history_img.png":
        xalign 0.5
        yalign 0.2
and this code just makes each line space out:
Image


anyone know what's wrong?

User avatar
Saltome
Veteran
Posts: 237
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#8 Post by Saltome » Thu May 11, 2017 3:54 pm

Can't really tell. Your history screen looks perfectly normal.
I assume you have changed various style settings, because this sure as hell doesn't look anywhere close to my history menu.
In which case I would need to see your screens.rpy and your gui.rpy files.
Deviant Art: Image

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#9 Post by Divona » Thu May 11, 2017 8:09 pm

I don't see why hbox is being use. It's for display things side by side. There also nothing showing on history screen that indicating the use of "game_menu" screen, so why does it still being used by history screen?

The way to adjusting the position of your history frame (vpgrid) is not in "screen history" but in "screen game_menu" vpgrid itself because you're still attached the game_menu in this history screen.

Personally, I would get rid the use of game_menu screen and do the independent vpgrid within history screen itself. But then, I don't know how your other screens are like.
Completed:
Image

ourdecemberdreams
Regular
Posts: 58
Joined: Sat Apr 15, 2017 3:26 pm
Projects: The Last December
Tumblr: ourdecemberdreams
Deviantart: ourdecemberdreams
itch: ourdecemberdreams
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#10 Post by ourdecemberdreams » Fri May 12, 2017 4:07 am

Divona wrote:I don't see why hbox is being use. It's for display things side by side. There also nothing showing on history screen that indicating the use of "game_menu" screen, so why does it still being used by history screen?

The way to adjusting the position of your history frame (vpgrid) is not in "screen history" but in "screen game_menu" vpgrid itself because you're still attached the game_menu in this history screen.

Personally, I would get rid the use of game_menu screen and do the independent vpgrid within history screen itself. But then, I don't know how your other screens are like.
I tried adding hbox because they give me an error when I just put ysize without the hbox
I've read and tried the vpgrid thingy, but I couldn't figure out how to do it ><
If I remove the "use game_menu(_("")", the game will give me an error instead
My other screens, do you mean my Credit and Preference page? Or do you mean all my other pages like my main screen and my dialogue screen?
Saltome wrote:Can't really tell. Your history screen looks perfectly normal.
I assume you have changed various style settings, because this sure as hell doesn't look anywhere close to my history menu.
In which case I would need to see your screens.rpy and your gui.rpy files.
Here's my history part in the gui.rpy if it helps~

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 = 10

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

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

## The position, width, and alignment of the dialogue text.
define gui.history_text_xpos = 200
define gui.history_text_ypos = 15
define gui.history_text_width = 700
define gui.history_text_xalign = 0.0
define _game_menu_screen = None

and the whole section of my history part in the screens.rpy

Code: Select all

## History screen ##############################################################
##
## This is a screen that displays the dialogue history to the player. While
## there isn't anything special about this screen, it does have to access the
## dialogue history stored in _history_list.
##
## https://www.renpy.org/doc/html/history.html

screen history():

    tag menu

    ## Avoid predicting this screen, as it can be very large.
    predict False
    
    use game_menu(_(""), scroll=("vpgrid2" if gui.history_height else "viewport2")):
        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"

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

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

    add "gui/history_img.png":
        xalign 0.5
        yalign 0.2
        
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
and my game menu part in the screens.rpy

Code: Select all

## Game Menu screen ############################################################
##
## This lays out the basic common structure of a game menu screen. It's called
## with the screen title, and displays the background, title, and navigation.
##
## The scroll parameter can be None, or one of "viewport" or "vpgrid". When this
## screen is intended to be used with one or more children, which are
## transcluded (placed) inside it.

screen game_menu(title, scroll=None):

    # Add the backgrounds.
    if main_menu:
        add gui.main_menu_background
    else:
        add gui.game_menu_background

    style_prefix "game_menu"

    frame:
        style "game_menu_outer_frame"

        hbox:

            # Reserve space for the navigation section.
            #frame:
                #style "game_menu_navigation_frame"
            null width 100
            frame:
                style "game_menu_content_frame"
                ysize 0.6
                if scroll == "viewport":

                    viewport:
                        scrollbars "vertical"
                        mousewheel True
                        draggable True

                        side_yfill True

                        vbox:
                            transclude
                            
                elif scroll == "viewport2":

                    viewport:
                        yinitial 1.0
                        
                        scrollbars "vertical"
                        mousewheel True
                        draggable True

                        side_yfill True

                        vbox:
                            transclude

                elif scroll == "vpgrid":

                    vpgrid:
                        cols 1
                        yinitial 1.0

                        scrollbars "vertical"
                        mousewheel True
                        draggable True

                        side_yfill True

                        transclude

                else:

                    transclude

    # use navigation

    imagebutton auto "gui/menu/return_%s.png":
        style "return_button"
        ypos 0.8
        xpos 600
        action Return() activate_sound "sfx/click.wav" hover_sound "sfx/hover.wav"

    label title

    if main_menu:
        key "game_menu" action ShowMenu("main_menu")


style game_menu_outer_frame is empty
style game_menu_navigation_frame is empty
style game_menu_content_frame is empty
style game_menu_viewport is gui_viewport
style game_menu_side is gui_side
style game_menu_scrollbar is gui_vscrollbar

style game_menu_label is gui_label
style game_menu_label_text is gui_label_text

style return_button is navigation_button
style return_button_text is navigation_button_text

style game_menu_outer_frame:
    bottom_padding 30
    top_padding 120

    background "gui/game_menu.jpg"

style game_menu_navigation_frame:
    xsize 280
    yfill True

style game_menu_content_frame:
    left_margin 40
    right_margin 20
    top_margin 10

style game_menu_viewport:
    xsize 920

style game_menu_vscrollbar:
    unscrollable gui.unscrollable

style game_menu_side:
    spacing 10

style game_menu_label:
    xpos 50
    ysize 120

style game_menu_label_text:
    size gui.title_text_size
    color gui.accent_color
    yalign 0.5

style return_button:
    xpos gui.navigation_xpos
    yalign 1.0
    yoffset -30

Let me know if there's anything else you need!

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#11 Post by Divona » Fri May 12, 2017 5:05 am

I see that you're using "viewport2" for history already. All you have to do is do the adjustment in there.

Code: Select all

screen game_menu(title, scroll=None):

    . . .

                elif scroll == "viewport2":

                    viewport:
                        yinitial 1.0

                        # Adjust size and position here.
                        side_ysize 400
                        side_ypos 80
                        
                        scrollbars "vertical"
                        mousewheel True
                        draggable True

                        vbox:
                            transclude
Completed:
Image

ourdecemberdreams
Regular
Posts: 58
Joined: Sat Apr 15, 2017 3:26 pm
Projects: The Last December
Tumblr: ourdecemberdreams
Deviantart: ourdecemberdreams
itch: ourdecemberdreams
Contact:

Re: Changing textbox height of History/Credits/Preference pa

#12 Post by ourdecemberdreams » Fri May 12, 2017 5:27 am

Divona wrote:I see that you're using "viewport2" for history already. All you have to do is do the adjustment in there.

Code: Select all

screen game_menu(title, scroll=None):

    . . .

                elif scroll == "viewport2":

                    viewport:
                        yinitial 1.0

                        # Adjust size and position here.
                        side_ysize 400
                        side_ypos 80
                        
                        scrollbars "vertical"
                        mousewheel True
                        draggable True

                        vbox:
                            transclude
omg it works!!! Thank you soooo much!!! :D

Post Reply

Who is online

Users browsing this forum: TioNick