Narrator textbox changing position?

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
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Narrator textbox changing position?

#1 Post by chesarty » Tue Jun 30, 2020 4:01 am

I have a little issue with my narrator-specific textbox. For every other character I use a textbox with a separate place for the name, and for the narrator I have a unique one.
Capture.PNG
The files are the exact same size, the only thing I changed was removing the namebox from the top. For some reason, though, the game shows the character textbox just fine but then with the narrator textbox it's barely visible...
huh.jpg
What the heck is up with that? Is there an easy fix for it?

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Narrator textbox changing position?

#2 Post by chesarty » Fri Jul 03, 2020 12:24 am

Still haven#t figured this out :(

User avatar
richycapy
Regular
Posts: 51
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: Narrator textbox changing position?

#3 Post by richycapy » Sun Jul 05, 2020 9:33 pm

Those options are fixed on the gui.rpy file, look for the "dialogue" X and Y vars and you need to "play" with them untill you can find the placement you want

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Narrator textbox changing position?

#4 Post by chesarty » Sun Jul 12, 2020 5:45 am

richycapy wrote:
Sun Jul 05, 2020 9:33 pm
Those options are fixed on the gui.rpy file, look for the "dialogue" X and Y vars and you need to "play" with them untill you can find the placement you want
I don#t see anything in the gui.rpy that indicates the position of the textbox image, only the text in said textbox. I also haven#t changed anything in the gui file so it shouldn't affect anything, right?

Here's the dialogue portion of my gui.rpy:

Code: Select all

## Dialogue ####################################################################
##
## These variables control how dialogue is displayed on the screen one line at a
## time.

## The height of the textbox containing dialogue.
define gui.textbox_height = 278

## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
## center, and 1.0 is the bottom.
define gui.textbox_yalign = 1.0


## The placement of the speaking character's name, relative to the textbox.
## These can be a whole number of pixels from the left or top, or 0.5 to center.
define gui.name_xpos = 360
define gui.name_ypos = 0

## The horizontal alignment of the character's name. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.name_xalign = 0.0

## The width, height, and borders of the box containing the character's name, or
## None to automatically size it.
define gui.namebox_width = None
define gui.namebox_height = None

## The borders of the box containing the character's name, in left, top, right,
## bottom order.
define gui.namebox_borders = Borders(5, 5, 5, 5)

## If True, the background of the namebox will be tiled, if False, the
## background of the namebox will be scaled.
define gui.namebox_tile = False


## The placement of dialogue relative to the textbox. These can be a whole
## number of pixels relative to the left or top side of the textbox, or 0.5 to
## center.
define gui.dialogue_xpos = 402
define gui.dialogue_ypos = 75

## The maximum width of dialogue text, in pixels.
define gui.dialogue_width = 1116

## The horizontal alignment of the dialogue text. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.dialogue_text_xalign = 0.0

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Narrator textbox changing position?

#5 Post by chesarty » Tue Aug 04, 2020 5:06 pm

I'm still having this issue. Tried copying an entire .gui file from another game of mine which doesn't have this issue and also triple-checked to make sure the two namebox files are the exact same size. I don't understand what's wrong?!

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Github: hell-oh-world
Location: Philippines
Contact:

Re: Narrator textbox changing position?

#6 Post by hell_oh_world » Tue Aug 04, 2020 8:10 pm

How are you changing the background you're using? By `window_background` in the character definition?

Code: Select all

define e = Character("Eileen",  window_background="e_bg.png")
define narrator = Character(None, window_background="n_bg.png")

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Narrator textbox changing position?

#7 Post by chesarty » Sun Aug 09, 2020 4:21 pm

hell_oh_world wrote:
Tue Aug 04, 2020 8:10 pm
How are you changing the background you're using? By `window_background` in the character definition?

Code: Select all

define e = Character("Eileen",  window_background="e_bg.png")
define narrator = Character(None, window_background="n_bg.png")
Sorry for late reply! This is how I do it:

Code: Select all

$ n = Character(None, window_background="gui/textbox_noname.png",)
and for every other character I don't define it since they use the default box (if that makes sense)? The narrator textbox is the only one not working.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Github: hell-oh-world
Location: Philippines
Contact:

Re: Narrator textbox changing position?

#8 Post by hell_oh_world » Mon Aug 10, 2020 1:52 am

Can you try using a `Frame` for the background? I'm guessing that this is an issue that should be fixed by a frame for most of the image stretching issues? try it with `x/yfill`
Also, character definitions must be defined outside labels, and it's better to stick to the convention of defining it using the `define` keyword.
so instead of...

Code: Select all

$ n = Character(None, window_background="gui/textbox_noname.png",)
it should be...

Code: Select all

define narrator = Character(
  None,
  window_background=Frame(
    "gui/textbox_noname.png", xfill=True, yfill=True
  ) # try also without xfill and yfill
)

label start:
  "Something..."
  return
and lastly, if it is the namebox is what you're trying to change solely here. it's better to separate the namebox image and the window background image and pass the namebox image along with the character definition but using a prefix...
https://www.renpy.org/doc/html/dialogue.html#Character
https://www.renpy.org/doc/html/config.h ... d_prefixes
This specifies a list of style property prefixes that can be given to a Character(). When a style prefixed with one of the given prefix is given, it is applied to the displayable with that prefix as its ID.

For example, the default GUI adds "namebox" to this. When a Character is given the namebox_background property, it sets background on the displayable in the say screen with the id "namebox".

Code: Select all

init python:
  config.character_id_prefixes.append("namebox")
  
define narrator = Character(
  None,
  namebox_background="the_image.png"
)
this one should work as the docs say...

Post Reply

Who is online

Users browsing this forum: No registered users