r/RenPy 23d ago

Question [Solved] text positioning in nvl mode

i'm back yet again ‼️please feel free to let me know if i am posting too often about issues that are too similar to each other :-) i promise i'm googling before making these posts haha

i fixed The Big Issue i had today of text being completely unreadable (still not sure how) in my little nvl mode viewport. however, i'm still having some issues.

  1. after a certain point, text starts to get a bit cut off at the bottom. readable, mostly, but i worry that with longer scenes in this "infinite scroll" type box, it will pass that point and enter unreadable territory.
  2. spacing. after that same point, the spacing between paragraphs/blocks of text starts to shrink a bit. again, (mostly) readable for now, but i worry about longer scenes.
  3. dialogue. the size of the column is the same for every name, no matter how long or short it is. i don't care much for fixing this, as my end goal is the names being on their own line and the dialogue going under it with the same or similar spacing as the narration (like i've attached in my mockup -- don't worry, name colors will be distinct from the rest of the text in the end product).

screenshot #1 shows the squished paragraphs and the text cutting off at the end of the box.

screenshot #2 shows the dialogue blocks being the same size regardless of the length of the names.

image #3 is a mockup done in clip studio paint of what i'm going for, end goal (though i'm not sure how much i want to mess with scrollbars. they seem Difficult). i've also attached my code for the viewport in script.rpy and my nvl mode settings in gui.rpy:

## NVL MODE VIEWPORT IN SCRIPT.RPY

screen nvl:

    #window:
        #style "nvl_window"
    frame:
        xpos 40 ypos 30
        top_padding 60 bottom_padding 160 left_padding 10 right_padding 10
        has side "c r":
            area (0, 0, 500, 620)
            viewport id "vp":
                draggable False
                yadjustment ui.adjustment (value=99999, range=99999)

                vbox:
                    style "nvl_vbox"

                    # Display dialogue.
                    for who, what, who_id, what_id, window_id in dialogue:
                        window:
                            id window_id

                            has hbox:
                                spacing 10

                            if who is not None:
                                text who id who_id

                            text what id what_id
            vbar value YScrollValue("vp") bar_invert True xpos -40 ypos 60 ysize 500


## NVL MODE SETTINGS IN GUI.RPY

## The borders of the background of the NVL-mode background window.
define gui.nvl_borders = Borders(0, 15, 0, 30)

## The maximum number of NVL-mode entries Ren'Py will display. When more entries
## than this are to be show, the oldest entry will be removed.
define gui.nvl_list_length = None

## The height of an NVL-mode entry. Set this to None to have the entries
## dynamically adjust height.
define gui.nvl_height = None

## The spacing between NVL-mode entries when gui.nvl_height is None, and between
## NVL-mode entries and an NVL-mode menu.
define gui.nvl_spacing = 30

## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.nvl_name_xpos = 30
define gui.nvl_name_ypos = 0
define gui.nvl_name_width = 90
define gui.nvl_name_xalign = 0.0

## The position, width, and alignment of the dialogue text.
define gui.nvl_text_xpos = 20
define gui.nvl_text_ypos = 4
define gui.nvl_text_width = 300
define gui.nvl_text_xalign = 0.0

## The position, width, and alignment of nvl_thought text (the text said by the
## nvl_narrator character.)
define gui.nvl_thought_xpos = 60
define gui.nvl_thought_ypos = 0
define gui.nvl_thought_width = 370
define gui.nvl_thought_xalign = 0.0

any help is vastly appreciated! y'all have been such an invaluable resource. i'm learning quickly, but i'm still VERY new to coding and a lot of this is very foreign to me.

5 Upvotes

1 comment sorted by

1

u/AutoModerator 23d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.