[Tutorial] Customizing the Textbox

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
ShirakiHime
Regular
Posts: 45
Joined: Sun Oct 30, 2011 2:40 pm
Projects: Mermaid Revelation (GxB otome)
Contact:

Re: [Tutorial] Customizing the Textbox

#46 Post by ShirakiHime »

Alex wrote:
i was wondering if I could put an animated one
You can make animated textbox using ATL
http://www.renpy.org/doc/html/atl.html# ... -atl-block
I will try this *A* thank you so much

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#47 Post by AERenoir »

Mmm, is there a way to script so that a different text box shows up for each of the different characters?

User avatar
FatUnicornGames
Miko-Class Veteran
Posts: 576
Joined: Sun Mar 25, 2012 7:54 pm
Projects: Club Shuffle
Contact:

Re: [Tutorial] Customizing the Textbox

#48 Post by FatUnicornGames »

I am just going to echo the chorus of thank yous for this tutorial. As someone who isn't a programmer it would be nigh impossible for me to have figured this out without your tutorial. I am going to put it to good use.
Image
Developer Blog for Club Shuffle - Follow and Share?
-Also! You can call me Crystal if you want.-

User avatar
Bellalea
Newbie
Posts: 22
Joined: Sun Jun 17, 2012 6:06 pm
Location: Finland
Contact:

Re: [Tutorial] Customizing the Textbox

#49 Post by Bellalea »

Thank you for this tutorial!

I don't know if this is a bit of OT, but I found this very good textbox maker. Check it out if you're not into making your own from a scratch ^^

http://www.grsites.com/generate/group/8000/

User avatar
Keinart
Regular
Posts: 133
Joined: Sun May 13, 2012 8:28 pm
Completed: One Thousand Lies
Projects: Lotus Reverie
Organization: Keinart Lobre
Tumblr: keinart
itch: keinart
Location: Spain
Contact:

Re: [Tutorial] Customizing the Textbox

#50 Post by Keinart »

Thank you for the tutorial, it really came in handy.

Now I have a question, does anybody knows how to put the namebox above the dialoguebox? I want them to overlap a little but the namebox appears below the dialoguebox when it should be the other way around.

Thanks!

User avatar
Nuxill
Veteran
Posts: 464
Joined: Sat Sep 25, 2010 4:50 pm
Projects: No Friend
Tumblr: nuxill
itch: nuxill
Contact:

Re: [Tutorial] Customizing the Textbox

#51 Post by Nuxill »

Keinart wrote:Thank you for the tutorial, it really came in handy.

Now I have a question, does anybody knows how to put the namebox above the dialoguebox? I want them to overlap a little but the namebox appears below the dialoguebox when it should be the other way around.

Thanks!
There's this: http://lemmasoft.renai.us/forums/viewto ... =8&t=14046
It's basically just switching the order of the who and what boxes in the textbox screen.

Ishikatsu
Regular
Posts: 34
Joined: Fri Jan 13, 2012 1:02 pm
Projects: Nemuri
Contact:

Re: [Tutorial] Customizing the Textbox

#52 Post by Ishikatsu »

Not going to say something meaningful; I just wanted to thank you. As a complete beginner, I still feel a little lost in Renpy, but this made everything so much more understanable. Thanks :)
Fear cuts deeper than swords.

User avatar
mdchan
Newbie
Posts: 18
Joined: Tue Sep 18, 2012 4:39 pm
Completed: Toby's Tales I
Projects: Dior (series)
Organization: The Lone Wolf
Location: USA
Contact:

Re: [Tutorial] Customizing the Textbox

#53 Post by mdchan »

First off, thank you!

Secondly...I saw the cookbook page for getting the menu buttons on the right side of the screen, but what if I want to put them on the bottom (sort of like the default text for save/load/preferences, but with buttons under the text window instead of to the right)?

Complete beginner, here...I know I have to adjust the x and y, but rather than frustrating myself further with it, I figured I'd ask.

Twisted-Eva
Regular
Posts: 138
Joined: Tue Jan 11, 2011 7:48 pm
Projects: Our Crossing Paths
Contact:

Re: [Tutorial] Customizing the Textbox

#54 Post by Twisted-Eva »

I got the padding to contain the Text right where I want it, but the problem is that the text box shrunk:
Textbox error.jpg
Deviantart Account
Current Project: Our Crossing Paths [GxB] [Alternate History/Drama]
Image

User avatar
Ran08
Miko-Class Veteran
Posts: 737
Joined: Tue Jun 12, 2012 1:17 am
Completed: https://ran.itch.io/
Projects: Fate's Cafe
Tumblr: otometwist
Skype: @otomeran
itch: ran
Location: Manila
Contact:

Re: [Tutorial] Customizing the Textbox

#55 Post by Ran08 »

Thank you very much for this! :) Very helpful.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#56 Post by Alex »

Twisted-Eva wrote:I got the padding to contain the Text right where I want it, but the problem is that the text box shrunk:
Textbox error.jpg
How did you make your textbox - as a pre-fitted image or an image to use as a frame (see the very beginning of the first post)?

Twisted-Eva
Regular
Posts: 138
Joined: Tue Jan 11, 2011 7:48 pm
Projects: Our Crossing Paths
Contact:

Re: [Tutorial] Customizing the Textbox

#57 Post by Twisted-Eva »

Alex wrote:
Twisted-Eva wrote:I got the padding to contain the Text right where I want it, but the problem is that the text box shrunk:
Textbox error.jpg
How did you make your textbox - as a pre-fitted image or an image to use as a frame (see the very beginning of the first post)?
Right, I edited my post so my code was deleted since I thought the problem might have been obvious. It's a pre-fitted image. Here's the code:

Code: Select all

    style.window.background = Frame("In game Text Box.png", 35, 35)

    ## Margin is space surrounding the window, where the background
    ## is not drawn.

    style.window.left_margin = 0
    style.window.right_margin = 0
    style.window.top_margin = 0
    style.window.bottom_margin = 0

    ## Padding is space inside the window, where the background is
    ## drawn.

    style.window.left_padding = 290
    style.window.right_padding = 44
    style.window.top_padding = 35
    style.window.bottom_padding = 35

    ## This is the minimum height of the window, including the margins
    ## and padding.

    style.window.yminimum = 291
Deviantart Account
Current Project: Our Crossing Paths [GxB] [Alternate History/Drama]
Image

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#58 Post by Alex »

Mmm...
pre-fitted image - is an image with the actual size that won't be changed during the game

Code: Select all

style.window.background = "In game Text Box.png"
if you plan that textbox will change its height from sentence to sentence then it's better to use frame (like you did)

Code: Select all

style.window.background = Frame("In game Text Box.png", 35, 35)
In second case be shure that "In game Text Box.png" doesn't have transparent canvas surrounding the actual textbox image (looks like for now it has lot of transparent canvas at top of the image).

Twisted-Eva
Regular
Posts: 138
Joined: Tue Jan 11, 2011 7:48 pm
Projects: Our Crossing Paths
Contact:

Re: [Tutorial] Customizing the Textbox

#59 Post by Twisted-Eva »

Ay... I fixed my pre-fitted image so it's correct, but now I can't figure out how to make the text fit nicely in it. I left some room on the left for a side image in the future.

Code: Select all

    style.window.background = Frame("In game Text Box.png", 0, 0 )

    ## Margin is space surrounding the window, where the background
    ## is not drawn.

    style.window.left_margin = 290
    style.window.right_margin = 0
    style.window.top_margin = 0
    style.window.bottom_margin = 0

    ## Padding is space inside the window, where the background is
    ## drawn.

    style.window.left_padding = 250
    style.window.right_padding = 44
    style.window.top_padding = 35
    style.window.bottom_padding = 35

    ## This is the minimum height of the window, including the margins
    ## and padding.

    style.window.yminimum = 291
Textbox error 2.jpg
Deviantart Account
Current Project: Our Crossing Paths [GxB] [Alternate History/Drama]
Image

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#60 Post by Alex »

Well, if you already left some free space between screen side and textbox for a side image, you don't need to set left_padding at all.

Post Reply

Who is online

Users browsing this forum: No registered users