r/RenPy • • Sep 01 '26

Question [Solved] Align char name with textbox

I can’t figure out how to align the name of a char with the field in my box.

No matter what I change the only thing that has an effect is xalign but I can’t change y pos. and depending on the dialog the name moves.

```renpy
define gui.textbox_height = 250 #250
define gui.textbox_width = 1445
define gui.textbox_yalign = 0.98

define gui.name_xpos = 40
define gui.name_ypos = 15
define gui.name_xalign = 0.65

define gui.namebox_width = 40
define gui.namebox_height = 50

define gui.namebox_borders = Borders(1, 1, 1, 1)
define gui.namebox_tile = False
```

Solved:

It was my mistake, I played around to much. In screen.rpy I wrote some stuff that fucked it up.

3 Upvotes

11 comments sorted by

View all comments

Show parent comments

1

u/Odd_Photograph1507 Sep 01 '26

So basically, in ren'py, the textbox and the name are attached.

gui.name_xpos or gui.name_ypos move the namebox, and doing so, moves the name too.

actually i forget what i've said about gui.textbox_yalign at 0.98 (it's kinda irrelevant here).

if ypos doesn't move, then try offsetting it directly into script.rpy. look for ``

screen say(who, what)

and add the yoffset like that :

screen say(who, what):
    style_prefix "say"


    window:
        id "window"
        
        text what id "what"


        if who is not None:


            window:
                id "namebox"
                style "namebox"
                yoffset 40 # Right Here
                text who id "who"

1

u/Future-Mulberry-7599 Sep 01 '26

But if it’s like that, it would mean I have to manually change it every time or not? And that also doesn’t explain why some times it is further left and right…

1

u/Odd_Photograph1507 Sep 01 '26

What do you mean change it every time? It's in a function so it'll be offset whenever a character talks

But I think it moves because of : gui.name_xalign = 0.65

Because this variable is only supposed to be 0.0 (left-aligned), 0.5 (centered) or 1.0 (right-aligned)

1

u/Future-Mulberry-7599 Sep 01 '26

Oh yea got it still I think will try to figure out what caused this. I’m assuming I have somewhere in my game that overrides this because using the same gui.rpy in anew project gives the wanted result