Centering dialogue in text box?

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
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Centering dialogue in text box?

#1 Post by warmsundae »

I don't think there's a topic for this, so how do you center dialogue text in the text box?
Last edited by warmsundae on Fri Apr 08, 2016 5:12 am, edited 2 times in total.

User avatar
YzzaPizzaIsCheezy
Regular
Posts: 64
Joined: Mon Feb 15, 2016 11:40 am
Completed: Best Friends
Projects: Sweet and Spices (NaNo'16)
Organization: Pastelle Studios, Classical Projects
Contact:

Re: Centering dialogue?

#2 Post by YzzaPizzaIsCheezy »

Like this:

Code: Select all

centered "Hello there."
you don't have to define it. :)

User avatar
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Re: Centering dialogue?

#3 Post by warmsundae »

thanks, but 'centered' puts it in the middle of the screen. I should've made it more clear - what I want is in the middle of the textbox, in the center of a line.

User avatar
MimirollCookie
Miko-Class Veteran
Posts: 725
Joined: Sat May 23, 2015 5:05 am
Completed: Best Friends (DRAMA), Sweet and Spices (NaNo16)
Projects: Cupid's Wish, Best Friends Deux
Organization: Pastelle Studios
Deviantart: MimirollCookie
Location: A place where rainbows and unicorns collide. ^0^
Contact:

Re: Centering dialogue?

#4 Post by MimirollCookie »

I don't knoe if there's something like that. ;_;
Image
"If they can do it, you can do it too! make them do it. They can do it, right?" :lol:
Getting a new laptop. Hopefully going back to VN making! (BWAHAHA)

User avatar
BáiYù
Regular
Posts: 131
Joined: Fri Apr 01, 2016 10:02 am
Completed: This Life Escapes Me, Up All Night, Lotus: The Self-Made Witch
Projects: Various
Organization: tofurocks, Fiendish Fiction, Spider Lily Studios
Github: baiyu-dev
itch: tofurocks
Contact:

Re: Centering dialogue?

#5 Post by BáiYù »

Simply go to your screens.rpy and locate the say screen section. Copy and paste this in at the first instance of has vbox.

Code: Select all

has vbox:
    style "say_vbox"
    xalign 0.5 #centers textbox
if who:
    text who id "who" xalign 0.5 #centers name
text what id "what" text_align 0.5
See if that works for you.
Image
Games and supplementary Ren'Py codes

User avatar
warmsundae
Regular
Posts: 61
Joined: Tue Feb 24, 2015 9:51 pm
Skype: electriclan
Soundcloud: lanterny
Location: korea
Contact:

Re: Centering dialogue?

#6 Post by warmsundae »

It works! Thanks so much.

edit:
I'm sure it's an easy fix, but how could I make the second/third/etc line of this dialogue centered as well?
Image

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Centering dialogue?

#7 Post by Donmai »

No need to hack the say screen. You can do it all with styles, as Tom explained here: http://lemmasoft.renai.us/forums/viewto ... 78#p392578
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Google [Bot]