Animated scrolling in text window? Animated window resizing?

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
BunnyInfernal
Regular
Posts: 34
Joined: Wed Dec 26, 2018 10:45 am
Contact:

Animated scrolling in text window? Animated window resizing?

#1 Post by BunnyInfernal » Fri Sep 02, 2022 9:58 am

Hi, all! I've got a little thing I've been playing with and I was hoping for a little help.

Inspired by some text games I've seen, I was curious if I could customize Ren'Py's UI to have a scrolling NVL window with stylized text boxes. I have something that looks like this so far:
text_window_1.jpg
Each new block of text appears below the last, and there's a scrollbar on the right so the player can scroll back once there's more than a screen's worth of text.

To make sure that the text window will automatically scroll to the bottom when new text is added that would otherwise be off the screen, I have this line of code in the window:

Code: Select all

yadjustment ui.adjustment (value=99999, range=99999)
My problem with it is that it doesn't quite feel right to me; because of how it all happens instantly, it can be a bit jarring and you almost don't notice the new text has appeared.

My question is: Is there a way to make the scrolling animated, so that it doesn't happen instantaneously? (I'm also curious if I can have a little animation for the blocks of text as they appear, as maybe that would make it a bit easier for the player to follow.)


Second question:
Related to the above; I've also been playing with resizing the text window so that images can occasionally be displayed at the top of the screen, like so:
text_window_2.jpg
I've found I can do this easily enough by defining...

Code: Select all

ysize text_window_height 
And then I can change text_window_height to resize the window.

To make that animated, I assume I'd need some kind of function to change the value over a period of time? I'm not sure the best way to do that in RenPy.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]