Scrolling text in NVL mode

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
User avatar
Taleweaver
Writing Maniac
Posts: 3428
Joined: Tue Nov 11, 2003 8:51 am
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Organization: Tall Tales Productions
Location: Germany
Contact:

Scrolling text in NVL mode

#1 Post by Taleweaver »

Title says it all. How do I make the text scroll as it reaches the bottom of the window in NVL mode? And how does this work with Rollback?
Scriptwriter and producer of Metropolitan Blues
Creator of The Loyal Kinsman
Scriptwriter and director of Daemonophilia
Scriptwriter and director of The Dreaming
Scriptwriter of Zenith Chronicles
Scriptwriter and director of The Thirteenth Year
Scriptwriter and director of Romance is Dead
Scriptwriter and producer of Adrift
More about me in my blog
"Adrift - Like Ever17, but without the Deus Ex Machina" - HigurashiKira

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Scrolling text in NVL mode

#2 Post by PyTom »

The current version of Ren'Py doesn't support scrolling the text when it hits the bottom of the window. (I'm not 100% what that even means - do we see the text moving up the screen?)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Taleweaver
Writing Maniac
Posts: 3428
Joined: Tue Nov 11, 2003 8:51 am
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Organization: Tall Tales Productions
Location: Germany
Contact:

Re: Scrolling text in NVL mode

#3 Post by Taleweaver »

PyTom wrote:The current version of Ren'Py doesn't support scrolling the text when it hits the bottom of the window. (I'm not 100% what that even means - do we see the text moving up the screen?)
I know it doesn't support it. That's why I'm asking for a how-to. It must be able to code something like this.

What I'm thinking of is a classic scrolling effect, like in the good old times. You're in front of a computer screen, you enter text, and if you enter more text than fits on the screen, once you get to the end of the last line on the screen, all the text you've typed moves up one line and you get a new line at the bottom of the screen.

It has always bugged me that NVL mode doesn't already do that by itself. Instead, when the text goes below the bottom boundary, it just does that - it goes on, and you can't read it because it's below the bottom boundary. How do I make it just scroll upwards?
Scriptwriter and producer of Metropolitan Blues
Creator of The Loyal Kinsman
Scriptwriter and director of Daemonophilia
Scriptwriter and director of The Dreaming
Scriptwriter of Zenith Chronicles
Scriptwriter and director of The Thirteenth Year
Scriptwriter and director of Romance is Dead
Scriptwriter and producer of Adrift
More about me in my blog
"Adrift - Like Ever17, but without the Deus Ex Machina" - HigurashiKira

AxemRed
Veteran
Posts: 482
Joined: Sun Jan 09, 2011 7:10 am
Contact:

Re: Scrolling text in NVL mode

#4 Post by AxemRed »

The complexity of a scrolling textbox depends on some implementation choices:
  • Is the up-scroll animated?
  • Is one line of text added at a time, or one sentence (possibly consisting of multiple lines)?
  • Are all lines the same height?
  • Is the text clipped at the top/bottom, or should there be a fading edge?
  • If there is a fading edge, is the background opaque?

User avatar
Taleweaver
Writing Maniac
Posts: 3428
Joined: Tue Nov 11, 2003 8:51 am
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Organization: Tall Tales Productions
Location: Germany
Contact:

Re: Scrolling text in NVL mode

#5 Post by Taleweaver »

  • Is the up-scroll animated?
    Needn't be. Would be sweet if possible, but it's not technically necessary.
  • Is one line of text added at a time, or one sentence (possibly consisting of multiple lines)?
    One sentence.
  • Are all lines the same height?
    Yes.
  • Is the text clipped at the top/bottom, or should there be a fading edge?
    Clipped.
  • If there is a fading edge, is the background opaque?
    There is no fading edge.
Scriptwriter and producer of Metropolitan Blues
Creator of The Loyal Kinsman
Scriptwriter and director of Daemonophilia
Scriptwriter and director of The Dreaming
Scriptwriter of Zenith Chronicles
Scriptwriter and director of The Thirteenth Year
Scriptwriter and director of Romance is Dead
Scriptwriter and producer of Adrift
More about me in my blog
"Adrift - Like Ever17, but without the Deus Ex Machina" - HigurashiKira

SvenTheViking
Regular
Posts: 65
Joined: Thu Dec 29, 2011 4:19 am
Projects: Chronicles of the Timetraveler's Wars
Organization: ProgMan Productions; Polymorphic Games
Location: Oregon
Contact:

Re: Scrolling text in NVL mode

#6 Post by SvenTheViking »

I'm not certain how to do it at the moment, but it's certainly something I'd be interested in having in my code library, now that you bring it up. It would make any sort of console interaction with computers in-game much easier to handle, if nothing else. Give me a bit to come up with something, and I'll see what I can do.

AxemRed
Veteran
Posts: 482
Joined: Sun Jan 09, 2011 7:10 am
Contact:

Re: Scrolling text in NVL mode

#7 Post by AxemRed »

I implemented something like that a few years back (though not in Ren'Py).

Everytime you would normally append text to the main textbox, instead you create a new Text object for that text. Internally, you store a list of all Text objects created this way. When the new Text object is added, you update the positions of all the text objects -- Place the last-added Text object wherever you want it on the screen, the walk the list of Text objects last to first, positioning Text objects one above the other.

To add clipping, place the Text objects in a Viewport? (not sure about the name) with the clipping bounds you want. When a Text object is moved out of the clipping rect on the top (text.y+text.h < clip.y), destroy it and remove it from your internal list of Texts.

SvenTheViking
Regular
Posts: 65
Joined: Thu Dec 29, 2011 4:19 am
Projects: Chronicles of the Timetraveler's Wars
Organization: ProgMan Productions; Polymorphic Games
Location: Oregon
Contact:

Re: Scrolling text in NVL mode

#8 Post by SvenTheViking »

I've hit a bit of a snag, in that I, for the life of me, can't understand the structure of the 'dialogue' list which contains the text to be displayed. Is it a multi-dimensional array placed inside a handy little wrapper or something? If so, how do I access individual elements, or, rather, the set of elements that is who, what, who_id, what_id, and window_id? There doesn't seem to be anything in the Ren'Py documentation on its structure, and it's only briefly mentioned in a few places, none of which do a bit of help in understanding how it works.

Am I better off digging through the source code for these answers?

Post Reply

Who is online

Users browsing this forum: Bing [Bot]