Change name position INSIDE namebox? [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
User avatar
MoonByte
Regular
Posts: 173
Joined: Thu Mar 24, 2016 9:18 pm
Completed: Shine (RPG Maker), Heroes (RPG Maker), Lantern Bearer (RPG Maker), Loop the Loop (Unity), Other Stars (Unreal), Sky Eye (RPG Maker), WIN Delivery & Fateful (Ren'Py)
Projects: Weird Is Normal (Ren'Py)
Location: Germany
Contact:

Change name position INSIDE namebox? [SOLVED]

#1 Post by MoonByte »

Heya o/
I am having a problem that is probably a single line that I overlooked 30 times now or something

So I have changed the size, look and position of the name box, modified the textbox and bla bla
But I can't figure out how to make the name in the namebox be higher than it is (position, not font size).
The name is too far left (and too low) in the namebox, making it look weird due to the design of it:
dfsca.png
I assume Renpy automatically centers the box around the name, even when you give it a fixed height and width?
If so, is there a way to override it and push the name just a tad right/up/etc WITHOUT moving the box with it?

The current namebox code is this btw, though I didn't really did anything spectacular there:

Code: Select all

define gui.name_xpos = 0
define gui.name_ypos = -30

define gui.name_xalign = 0

define gui.namebox_width = 350
define gui.namebox_height = 80

define gui.namebox_borders = Borders(5, 5, 5, 5)
Last edited by MoonByte on Tue May 05, 2020 3:46 pm, edited 1 time in total.

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Change name position INSIDE namebox?

#2 Post by isobellesophia »

How about if you copy the old script from the 'Question' novel and replace it with the current namebox script? Sorry if thats all i can help,
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Change name position INSIDE namebox?

#3 Post by Jackkel Dragon »

Well, for one, this line forces the text to be entirely to the left side of its dimensions:

Code: Select all

define gui.name_xalign = 0
If you want centered text, setting an align value to 0.5 is the best option. Decimal pos/anchor/aligns are based on current screen/box sizes. So xalign 0.5 in a 100 wide box is the same as xalign 50.

I'm more familiar with editing screens directly, but try playing with that line and a line for yalign. (And maybe remove the pos statements for name, since align sets pos.)
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

User avatar
MoonByte
Regular
Posts: 173
Joined: Thu Mar 24, 2016 9:18 pm
Completed: Shine (RPG Maker), Heroes (RPG Maker), Lantern Bearer (RPG Maker), Loop the Loop (Unity), Other Stars (Unreal), Sky Eye (RPG Maker), WIN Delivery & Fateful (Ren'Py)
Projects: Weird Is Normal (Ren'Py)
Location: Germany
Contact:

Re: Change name position INSIDE namebox?

#4 Post by MoonByte »

Ah, I didn't consider that I could center with align and THEN move with pos.
See, I assumed it is a simple answer for a stupid problem xD"

Thanks, I had to play a bit to move it back in position, but it looks good now!

Thanks Jackkel!
And Isobelle, while not necessary now, it's actually good advice, I use Renpy for so long now that I sometimes forget about the literal tutorial haha

___

To anyone needing it, I changed this

Code: Select all

define gui.name_xpos = 0
define gui.name_ypos = -30

define gui.name_xalign = 0
to this (for my specific GUI, but the logic applies with others too, one'd guess)

Code: Select all

define gui.name_xpos = 160
define gui.name_ypos = -30

define gui.name_xalign = 0.5

Post Reply

Who is online

Users browsing this forum: No registered users