Placing Dialog Boxes anywhere on the screen

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
Ragnaor
Newbie
Posts: 2
Joined: Wed Apr 26, 2017 10:49 am
Contact:

Placing Dialog Boxes anywhere on the screen

#1 Post by Ragnaor »

Hi,

I'm currently doing a visual novel on Ren'py as part of my studies as a game designer.

I would like to know how to place dialog boxes anywhere on the screen. (We've been struggling for a few days)

For example, for added dynamism, we would like the dialog boxes to appear directly on the character (mid screen), or basically ,anywhere else besides the classical bottom of the screen .

Moreover, is it possible to display a dialog box without defining a character? ( one that would still react to the player clicking)

Thanks in advance!

renpic
Newbie
Posts: 19
Joined: Sat Apr 08, 2017 1:07 pm
Location: Europe
Contact:

Re: Placing Dialog Boxes anywhere on the screen

#2 Post by renpic »

Ragnaor wrote:Hi,

I'm currently doing a visual novel on Ren'py as part of my studies as a game designer.

I would like to know how to place dialog boxes anywhere on the screen. (We've been struggling for a few days)

For example, for added dynamism, we would like the dialog boxes to appear directly on the character (mid screen), or basically ,anywhere else besides the classical bottom of the screen.
Then you should look into gui.rpy, particularly at this line:

Code: Select all

define gui.textbox_yalign = 1.0
You can change it to 0.0, and the textbox will be at the top of the screen; or 0.5, to have it right in the middle, etc.
Moreover, is it possible to display a dialog box without defining a character? ( one that would still react to the player clicking)
You mean, like narrator lines?

That is simply done with something like this:

Code: Select all

 "Hello, world."

renpic
Newbie
Posts: 19
Joined: Sat Apr 08, 2017 1:07 pm
Location: Europe
Contact:

Re: Placing Dialog Boxes anywhere on the screen

#3 Post by renpic »

renpic wrote:You mean, like narrator lines?
Or maybe you were thinking about something like this:

Code: Select all

show text "Hello World!" at truecenter 

Ragnaor
Newbie
Posts: 2
Joined: Wed Apr 26, 2017 10:49 am
Contact:

Re: Placing Dialog Boxes anywhere on the screen

#4 Post by Ragnaor »

Ok! Thanks a lot for your answers ! Back to work !

renpic
Newbie
Posts: 19
Joined: Sat Apr 08, 2017 1:07 pm
Location: Europe
Contact:

Re: Placing Dialog Boxes anywhere on the screen

#5 Post by renpic »

renpic wrote: Then you should look into gui.rpy, [...]
You can change it [...]
BTW, there is no need to edit gui.rpy, you should be able to do it just from script.rpy. Add at the beginning:

Code: Select all

init:                                                                           
    python:                                                                     
        gui.textbox_yalign = 0.0
and that's it! :smile:

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]