How to change the scale of custom Namebox?

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
candycorn
Newbie
Posts: 2
Joined: Tue May 12, 2020 2:52 am
Contact:

How to change the scale of custom Namebox?

#1 Post by candycorn »

Hi guys, I'm pretty new to Renpy and I'm having a lot of trouble implementing my custom namebox.

I tried changing the size of the nametag.png file, which was originally the same resolution size as my game (1920 x 1080), but it showed up really small. I cropped it so it's just the namebox, and then it showed up looking like this:

https://imgur.com/Qx6u99K

The namebox is the exact same size as the name, but I want it to be bigger like this:

https://imgur.com/WL7RgOE


This is what my code looks like now:

Code: Select all

## 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 = 480
define gui.name_ypos = -0.3

## 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(8, 8, 8, 8)

## 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 = 480
define gui.dialogue_ypos = 44
-----
I also tried changing the code to:

Code: Select all

## The width, height, and borders of the box containing the character's name, or
## None to automatically size it.
define gui.namebox_width = 100
define gui.namebox_height = 50
It looked like this:
https://imgur.com/z0MJRyt

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How to change the scale of custom Namebox?

#2 Post by Alex »

Try either set the namebox width big enough to keep any name you'll use in your game, or change the namebox borders

Code: Select all

define gui.namebox_borders = Borders(8, 8, 8, 8)
https://www.renpy.org/doc/html/gui.html#borders

Post Reply

Who is online

Users browsing this forum: No registered users