Text-box size...

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
JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Text-box size...

#1 Post by JD_Mortal »

Forgive me for such a noob question, but the first thing that is killing me, is the fixed-size text-box.

This is great for writing a lot of text, but that almost defeats the purpose of clicking-through.

Is there a way to make that Auto-height, so it adjusts to the actual text it needs to display?

Also, is there an auto-kearning, AKA: Justified-alignment or paragraph-alignment or true-alignment? (If not, I can help with the development of that.)

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Text-box size...

#2 Post by Asceai »

Is there a way to make that Auto-height, so it adjusts to the actual text it needs to display?
The textbox isn't fixed-size - it expands as you include more text!

It does, however, have a minimum height. You can change that

Code: Select all

style say_window yminimum 0
Also, is there an auto-kearning, AKA: Justified-alignment or paragraph-alignment or true-alignment? (If not, I can help with the development of that.)
Yes

JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Re: Text-box size...

#3 Post by JD_Mortal »

Thank-you.

I added this... (code) to my script.rpy (Wasn't exactly clear where to put it at first. BTY "true" causes an error and "True" or 1 does not seem to do anything.)

Code: Select all

style say_window:
    yminimum 100
    justify True
Am I doing it wrong?

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Text-box size...

#4 Post by Asceai »

justify isn't a style property for the say_window, it's a style property for text
You can shift-I when debug mode is on (the default) when the mouse is over a styleable element to see the styles that affect it. I think it's something like 'say_dialogue' for dialogue (that is, a name and text) and 'say_thought' for narrative.
Alternatively you can apply it per-character:

define e = Character("Eileen", what_justify=True)

or apply it to all text
style default justify True

JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Re: Text-box size...

#5 Post by JD_Mortal »

Thanks again...

Where did you get the what_ thing from.. and what is that?

Yea, I noticed weird things...

Justify does nothing on say_window... Have to use say_dialogue... but that only works if you say something with a quoted name... Grrr...

Eg.. (works here)
"SomeGuy" "Hello"
e "hello"

Eg.. (Does not work here)
"hello"

Not sure I want default to have all those attributes, since it applied similar settings to everything when I used default.

Is there a "default_dialogue"? (I am having a hard time finding all the custom names for all these unique default things. Not sure where all that information is located. The help-files don't say any of this stuff in the text area.)

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Text-box size...

#6 Post by Asceai »

Like I said, you also have to style say_thought to cover narrative.

what_ parameters have the 'what_' part stripped off and are passed to the dialogue text. See 'styling text and windows' at the bottom of the Character part of the manual.

JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Re: Text-box size...

#7 Post by JD_Mortal »

Tricked it into thinking it has a name... Now it works...

Used this...
"" "hello"

Instead of this...
"hello"

(That was for the say_dialogue, where justify had to go.)

Were is all this information? Are you guys looking at the python code or something to get this info?

Edited: You answered as I was typing.
Last edited by JD_Mortal on Mon Jul 21, 2014 6:46 am, edited 2 times in total.

JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Re: Text-box size...

#8 Post by JD_Mortal »

double-post

Dude, You rule. If you accepted honorcoins, I would give you some.
Last edited by JD_Mortal on Mon Jul 21, 2014 6:42 am, edited 2 times in total.

JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Re: Text-box size...

#9 Post by JD_Mortal »

Asceai wrote:Like I said, you also have to style say_thought to cover narrative.

what_ parameters have the 'what_' part stripped off and are passed to the dialogue text. See 'styling text and windows' at the bottom of the Character part of the manual.
Yea, I don't quite grasp that... I am sure I will in time... but What_ Who_ Where_ When_ Why_... WTF? Prefix, suffix... (Mr. Bob = Who_bob?)

BTW, I feel like I am in Watchdogs now.. you just "opened my world". xD Literally!

JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Re: Text-box size...

#10 Post by JD_Mortal »

New problem...

The code I have...

Code: Select all

style say_window:
    yminimum 0
    xmargin 10
    bottom_margin 15
    xpadding 10
    ypadding 5

style say_dialogue:
    first_indent 54
    rest_indent 0
    justify True
    
style say_thought:
    first_indent 54
    rest_indent 0
    justify True
Localized bug to justify... Only happens when there are more than three lines to justify, or more. Two lines is justified correctly. Just reported it. xD

JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Re: Text-box size...

#11 Post by JD_Mortal »

Adding a note:

The vbox ignores any "set sizes". Seems it auto-compresses, seen when centering while justified, with a set-width.

This, I am using to my advantage. However, I have to make sure the outer window that should "contain" the vbox, is larger, since it seems that the vbox actually floats outside of the window that it should be inside of. (Might be a container-encapsulation issue there. It thinks it is inside the window, but it is actually floating in front of it, thus, not "limiting itself" to the parent that it is not actually within.)

If it were within the window, as the "SHIFT+I" information suggests, then the text would not be drawn on-top and outside the window, it would be clipped, behind the window. Also, the width would not be expanding to the screen-width, but the actual dialogue window width.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]