Renpy - Applying different styles of dialogue box for dialogues in the dialogue's line of code.

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
Strobot
Newbie
Posts: 4
Joined: Fri Apr 27, 2018 11:04 pm
Contact:

Renpy - Applying different styles of dialogue box for dialogues in the dialogue's line of code.

#1 Post by Strobot »

So here is the code for the different dialogue box styles in screen.rpy the one is used for regular character dialog and another for any kind of input dialog

Code: Select all

style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

    background Image("gui/gui_textbox.png", xalign=0.5, yalign=1.0)
    
    
 style input_window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

    background Image("gui/gui_textbox_narr.png", xalign=0.5, yalign=1.0)

So for the pov dialog the games uses dialogue window style - textbox.png
and for dialogues which are not affiliated to any character it also uses the same dialogue window style - textbox.png . And here is code for that

Code: Select all

# for dialog affiliated with characters 
pov " Hello world"
# for dialog affiliated with no characters
"Hello world"
So here is what i want to do :--
I want to use gui_textbox_narr.png for dialog affiliated with no characters, there any way to code in to the specified dialogue box style right next to the dialogue
like

Code: Select all

"Hello World",style = use input_window
Any help from the community would help me immensely in developing my game . Thank you in advance.

Here is some images to help you understand the dialogue box image properly
https://imgur.com/a/fkYi20I


1) This the image for dialog box affiliated with characters

2) This the image that i want to use for dialog box affiliated with no characters and also for the input dialog .

3) I want to replace the dialog box (which is style window) for this dialogue with style input_window .


Strobot
Newbie
Posts: 4
Joined: Fri Apr 27, 2018 11:04 pm
Contact:

Re: Renpy - Applying different styles of dialogue box for dialogues in the dialogue's line of code.

#3 Post by Strobot »

kostek00 wrote: Tue Oct 02, 2018 4:57 pm You can use special character "narrator" for that "define narrator = Character(None, window_background="gui_textbox_narr.png")".
https://www.renpy.org/doc/html/store_va ... r-narrator
https://www.renpy.org/doc/html/dialogue ... characters
https://www.renpy.org/doc/html/dialogue ... #Character
Thank you, i never though of creating a new character , but nonetheless this was very helpful

User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Renpy - Applying different styles of dialogue box for dialogues in the dialogue's line of code.

#4 Post by kostek00 »

It's not quite like you are creating new character. Narrator is by default created by renpy itself and all you do is attach additional options to it. Writing "narrator "some dialog"" is the same as writing dialog line without writing name of character before it.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]