How to get Text into the 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
Xent
Regular
Posts: 53
Joined: Sun Sep 23, 2007 1:40 pm
Contact:

How to get Text into the Box

#1 Post by Xent »

Can someone please help me.
I was wondering how I can get the text in renpy into the box.

(http://img413.imageshack.us/img413/7020/ex4v.jpg)

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: How to get Text into the Box

#2 Post by Jake »

Xent wrote:Can someone please help me.
I was wondering how I can get the text in renpy into the box.

(http://img413.imageshack.us/img413/7020/ex4v.jpg)
Basically, you'll need to play around with style properties, which allow you to change all kinds of different settings to do with how particular elements get displayed.

You can find out what styles are being used anywhere in your Ren'Py game by hovering the mouse over the thing you're interested in and hitting Shift-I to bring up the style inspector (although this only works when developer mode is set on, which is the default).

In this case, you'll want to modify the left_padding, right_padding, top_padding and bottom_padding properties of the 'say_window' style - these control how much of a gap is left inside the absolute-outermost-limits of a window before the text inside that window (or whatever else is inside) gets drawn:

Code: Select all

init python:
    style.say_window.left_padding = 20
    style.say_window.right_padding = 20
    style.say_window.top_padding = 30
    style.say_window.bottom_padding = 10
(If you use whole numbers, then you're specifying the distance in pixels; if you use decimal numbers, you're specifying the distance in terms of proportion of the screen width/height.)


The problem you're having is caused by the fact that as far as Ren'Py's concerned, the 'window' which is being used for dialogue stretches all the way to the sides and bottom of the screen, and further up than you can see - the absolute outer edges of your window-graphic reach to the absolute outer-edges of the Ren'Py window, but unless you use those properties to tell it, Ren'Py doesn't know how far into the picture file the actual edges of the graphic are and how far in the text should be drawn.
Server error: user 'Jake' not found

Xent
Regular
Posts: 53
Joined: Sun Sep 23, 2007 1:40 pm
Contact:

Re: How to get Text into the Box

#3 Post by Xent »

Could you also tell me how to edit the total width of the window?

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: How to get Text into the Box

#4 Post by Jake »

Xent wrote:Could you also tell me how to edit the total width of the window?
Again, with style properties. On the window you can set properties like "xmaximum" and "xminimum" to set the maximum-allowed and minimum-allowed widths. (There's also a 'yminimum' and 'ymaximum' for height.) Whenever I've wanted to set the width of something explicitly I've gone for that - set the xmaximum and xminimum to the same value.
Server error: user 'Jake' not found

Xent
Regular
Posts: 53
Joined: Sun Sep 23, 2007 1:40 pm
Contact:

Re: How to get Text into the Box

#5 Post by Xent »

ok thanks its working

Post Reply

Who is online

Users browsing this forum: Ocelot, Zahdernia