Ren'Py Text not as overlay

wildcat99sh

Active Member
Aug 31, 2017
526
570
Hi there,

i'm pretty new to Ren'Py, looked into the documentation and also here but cannot find a solution for my "problem".

Normally you show an image and then you let one of persons say something.
This text is displayed as an overlay over the e.g. most bottom 20% of the image.

OK, i can hide the textbox with key H.

But i would like to have two lets say areas on the screen. One only for the text and one above where the image is shown and always visible in total.

Is this possible at all?

Thanks in advance
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,573
2,201
Yes.

You're looking at using an addition .
A screen can be as simple or complex as you need. From a single line of text to a whole interface of interactive "stuff".

Essentially, you create an overlay (the screen) to be added and then use the show screen {nameofscreen} command in your code to add that screen to the existing layout.

That screen will remain, until you remove it through code (or never).

The textbox at the bottom of the screen with the character dialogue is a predefined screen. The "quick bar" at the very bottom of the screen with various shortcuts to things like load and save is a separate predefined screen. Likewise, there is a predefined screen usually shown in the bottom left that will optionally show the current speaking character's portrait/image.

If you want to add a screen to the game and just leave it there for the player to see/use, use show screen ...
If you want to add a screen to the game, but force the player to interact with that screen before continuing the game, use call screen ....

Another way to show text (but not permanently leave it on screen) is to use centered. "centered" is a special preassigned character that "speaks" in the middle of the screen rather than in the usual dialogue textbox at the bottom. It doesn't sound like that's what you need - but I'll mention it just in case.
Use it like : centered "Time passes...".
 

wildcat99sh

Active Member
Aug 31, 2017
526
570
I (almost) understand and think i know what you mean. Thanks so far.

Buti still don't know how to achieve it, although i've read the docs...

I think, i define a new screen, big enough holding my images, and place this new screen above the dialog box.

Assume all the images in my VisNov are 1280*720 and they should be displayed without being disturbed by the dialog box, then the whole Gui must be adopted in the new height, right?

And what if the user resizes the whole Game-Window?

I Attaqched a small pic explaining my strugle...

Thx.
RenPyScreens.jpg
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,573
2,201
The player can only scale the game window.
If your game is 1280x720 and the player resizes it to 2560x1440 - the game will still behave as everything is still 1280x720, just bigger. Bottom right will still be 1280x720 to your game, even though the physical pixels is nearer 2560x1440.

If you're worried about things, then code your screen to use instead of .
But honestly, it doesn't actually matter to the player. Maybe xalign=1.0, yalign=0.6 for a position on the right hand side of the screen, a little below the middle vertically.

Overall, the screen is just a collection of objects/displayables within other objects/displayables.

For you... I'd expect it to be screen -> window or frame -> vbox -> text, where the frame/window is the thing that is positioned and sized then contains a vbox, which in turn contains the text you want to display. The frame/window and the vbox I've mentioned are somewhat optional. You could just use a text screen element, but positioning the text within a vbox and then putting that vbox within a frame/window is much more usual for how text is displayed within RenPy games, since it is way more flexible when it comes to adding more text or buttons or anything else.

Think of frame/window as being a positional canvas. A vbox is like a column of cells within a spreadsheet. Then the text is each cell. Unless overriden, most of those elements will auto size relative to the size of their contents.
 

wildcat99sh

Active Member
Aug 31, 2017
526
570
Think of frame/window as being a positional canvas. A vbox is like a column of cells within a spreadsheet. Then the text is each cell. Unless overriden, most of those elements will auto size relative to the size of their contents.
Thanks a lot, i got it. With this "pictures" i have a far clearer understanding and will start playing around with it.