[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
User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: [Tutorial] Customizing the Textbox

#91 Post by Kia »

PyTom wrote: But this may not work if you're using show_two_window.
yes breaking windows in two made it hard to figure out what is holding what. I mean say_who_window holds say_what_window now but it seems something is holding say_who_window because I can't align it to the screen now.

User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: [Tutorial] Customizing the Textbox

#92 Post by Kia »

so... is it possible to have to have this kind of chat window?

Edit: yes it's possible!
with the help of:

Code: Select all

style.say_who_window.xfill=True
and:

Code: Select all

show_two_window=True,window_xalign=1.0,who_xalign=1.0,

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

Re: [Tutorial] Customizing the Textbox

#93 Post by Alex »

You need to modify say screen by adding variables that will let you control the positions of elements of the screen, like

Code: Select all

##############################################################################
# Say
#
# Screen that's used to display adv-mode dialogue.
# http://www.renpy.org/doc/html/screen_special.html#say
screen say:

    # Defaults for side_image and two_window
    default side_image = None
    default two_window = False

    default x = 0.0

    # Decide if we want to use the one-window or two-window variant.
    if not two_window:

        # The one window variant.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"
            xalign x

            if who:
                window:
                    style "say_who_window"
                    xalign x

                    text who:
                        id "who"
                        xalign x

            window:
                id "window"

                has vbox:
                    style "say_vbox"
                    xalign x

                text what id "what" xalign x

    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0

    # Use the quick menu.
    use quick_menu

Code: Select all

# Declare characters used by this game.
define s = Character('Sylvie', color="#c8ffc8", show_two_window=True)
define e = Character('Eileen', color="#c8ffc8", show_two_window=True, show_x = 1.0)

# The game starts here.
label start:

    e "1 text"
    s "2 text"
    e "3 text"
    s "4 text"
Some more on this - http://lemmasoft.renai.us/forums/viewto ... 02#p309592

Ina

Re: [Tutorial] Customizing the Textbox

#94 Post by Ina »

N/A
Last edited by Ina on Mon Jul 12, 2021 1:28 pm, edited 1 time in total.

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

Re: [Tutorial] Customizing the Textbox

#95 Post by Luxliev »

Great tutorial thanks for sharing. Two questions.
1) Is it possible to change the dimensions or placement of text window?
2) Can you have two text windows showing different stuff.
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

User avatar
Karen
Newbie
Posts: 19
Joined: Sat Feb 28, 2015 4:25 pm
Contact:

Re: [Tutorial] Customizing the Textbox

#96 Post by Karen »

why does it keep saying
true not defined?
Relaxing Visual Novel Creator
Image

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: [Tutorial] Customizing the Textbox

#97 Post by Aleema »

You need to always capitalize the T in True.

User avatar
Regaliaz
Newbie
Posts: 1
Joined: Tue Apr 07, 2015 9:14 am
Contact:

Re: [Tutorial] Customizing the Textbox

#98 Post by Regaliaz »

i got the problem with this :( anyone can help me ?
i got error message when i edit the textbox

here my script

Code: Select all

 #########################################
    ## These settings let you customize the window containing the
    ## dialogue and narration, by replacing it with an image.

    ## The background of the window. In a Frame, the two numbers
    ## are the size of the left/right and top/bottom borders,
    ## respectively.

       style.window.background = "image/example.png"

    ## 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 = 6
       style.window.right_padding = 6
       style.window.top_padding = 6
       style.window.bottom_padding = 6

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

       style.window.yminimum = 250
here error report
Attachments
error.jpg

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: [Tutorial] Customizing the Textbox

#99 Post by Aleema »

The error says that your line is indented improperly. Make sure that line of code is inline with the lines of code above and below it.

User avatar
bloodyhair
Regular
Posts: 61
Joined: Tue Aug 11, 2015 7:20 am
Deviantart: Takada-Wang
Contact:

Re: [Tutorial] Customizing the Textbox

#100 Post by bloodyhair »

Thank you so much for your tutorial! <3 It is really great :D

I have some question regarding the font. I want to change my font into DotumChe. I tried to copy it from my font tab in control panel, but when I copy it to D:// section, it changed into GULIM and I don't know how to fix it.

Maybe anyone can help me so I can get this specific type of font?

Lightworker
Regular
Posts: 104
Joined: Sun Dec 13, 2015 2:06 pm
Projects: Detroit.exe
Discord: Happiness+#1168
Contact:

Re: [Tutorial] Customizing the Textbox

#101 Post by Lightworker »

Am I doing this correctly?

Code: Select all

style.window.background = Frame("sport.png", 12, 12)

    $ m = Character('Marcus', window_background="orange.png")

    $ narrator = Character(None, window_background="bubbly.png")
Every time I put it in it says syntax error. Why is there a "$" I never seen it before... so why is it used right here?


Lightworker
Regular
Posts: 104
Joined: Sun Dec 13, 2015 2:06 pm
Projects: Detroit.exe
Discord: Happiness+#1168
Contact:

Re: [Tutorial] Customizing the Textbox

#103 Post by Lightworker »

Thanks for your help :) , but I have a new problem. How do I change the character dialogue color NOT the name to another color.

Code: Select all

define m = Character('Marcus', color="#FFFFFF", window_background="orange.png", say_thought.color="#FFb448" )
define a = Character('Alexis', color="#FFFFFF", window_background="pink.png", say_thought.color="##FFc0cb")
I get the textbox and the name color correct. However, how do I change the font color of the character's dialogue.

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

Re: [Tutorial] Customizing the Textbox

#104 Post by Alex »

Try to add what_color parameter to your character's definition.
http://www.renpy.org/doc/html/dialogue. ... er-objects

Lightworker
Regular
Posts: 104
Joined: Sun Dec 13, 2015 2:06 pm
Projects: Detroit.exe
Discord: Happiness+#1168
Contact:

Re: [Tutorial] Customizing the Textbox

#105 Post by Lightworker »

:D Awesome thanks, Just one last question. How can I enlarge the character name to push down the text in this textbox?
Attachments
As you can see, I got the color I want but it's blending with the namebox a little bit.
As you can see, I got the color I want but it's blending with the namebox a little bit.
NameProblem.PNG (7.96 KiB) Viewed 1931 times

Post Reply

Who is online

Users browsing this forum: No registered users