Text not justified or centered [ 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
JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Text not justified or centered [ SOLVED]

#1 Post by JinzouTamashii »

The text isn't justifying...

Everyone takes the kind=char property and char has it enabled, but the first and second lines are not justified... I also can't seem to center it now, though I have declared what_xalign=0.5 as a tuple.

I can take them out or add them, it doesn't matter. Absolutely nothing changes.

Code: Select all

$ char = Character(what_slow_cps=35, who_suffix = ':', what_prefix='“', what_suffix='”', ctc=anim.Blink("arrow.png", xpos=760, ypos=560, xanchor=0, yanchor=0), ctc_position="fixed", show_two_window=True, show_who_window_properties={ "background" :  "namebox.png" }, what_font="MPlantin.ttf", color="#D1D1D1", what_outlines=[ (1, "#678")], justify=True, window_right_padding=110, what_xalign=0.5)
notjustified.PNG
It's a lame placeholder but please ignore it.

This is the character's code.

Code: Select all

$ m = Character('Madhavi', color="#9966CC", what_outlines=[ (1, "#A7B") ], kind=char)
I would also like to add the outline into the namebox.
Last edited by JinzouTamashii on Sat Oct 31, 2009 1:55 am, edited 1 time in total.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Papaxibe
Newbie
Posts: 7
Joined: Wed Apr 18, 2007 2:04 am
Projects: Season of Sakura Brasil
Location: Brazil
Contact:

Re: Text not justified or centered

#2 Post by Papaxibe »

Hi JinzouTamashii

The problem is the Character Object doesn't have the property justify. This property is from the TEXT of the Character. Then, you must declare a style for your character, this style has the property justify.

Example:

Code: Select all

$ style.create("justify_style", "default", u"(text) Justify Style")

$ style.justify_style.justify = True

$ char = Character(what_slow_cps=35, who_suffix = ':', what_prefix='“', what_suffix='”', ctc=anim.Blink("arrow.png", xpos=760, ypos=560, xanchor=0, yanchor=0), ctc_position="fixed", show_two_window=True, show_who_window_properties={ "background" :  "namebox.png" }, what_font="MPlantin.ttf", color="#D1D1D1", what_outlines=[ (1, "#678")], what_style = "justify_style", window_right_padding=110, what_xalign=0.5)
Thanks for attention

Papaxibé
Enquanto as andorinhas pastarem a relva selvagem, e os elefantes salpicarem de galho em galho, um velho sentado na pedra de pau, calado assim dizia: os três sábios da antiguidade eram quatro, Danúbio e Jacó.

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Text not justified or centered [ SOLVED! ]

#3 Post by JinzouTamashii »

Oh! I have learned something new now! I am sure this will be helpful to everyone!
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Text not justified or centered [ SOLVED]

#4 Post by JinzouTamashii »

I wonder if I can also turn

Code: Select all

style.say_who_window.xalign = 0.25
for the namebox into a style only to be inherited by certain characters (major ones with portraits)?
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Text not justified or centered [ SOLVED]

#5 Post by PyTom »

Rather than creating an entire new style, you could have simply added:

what_justify=True

to the character. In a character, style properties can be used with prefixes. the what_ prefix applies to the actual dialogue. The window_ prefix applies to the window. The who_ prefix (or no prefix at all) applies to the name of the Character.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Text not justified or centered [ SOLVED]

#6 Post by JinzouTamashii »

I bow to the King of Ren'Py...

I am only a lowly minion trying to learn his Majesty's much-vaunted arts... I will sure scribe this wisdom for future reference.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Post Reply

Who is online

Users browsing this forum: Google [Bot]