Text Speed Preview?

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
HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Text Speed Preview?

#1 Post by HigurashiKira » Tue Mar 13, 2012 6:15 pm

Just a quick question: is it possible to make a text speed preview? (As in, give a preview of how fast the text will move)

The clip is an example of what I mean
I have moved to a new account. Please contact me here from now on. T/Y~

User avatar
PyTom
Ren'Py Creator
Posts: 15468
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: Text Speed Preview?

#2 Post by PyTom » Thu Mar 15, 2012 12:11 am

Yes, but not exactly like that.

The basics of a text speed menu is a second screen, something like:

Code: Select all

screen text_test:
    frame:
        xalign 0.5 yalign 0.5
        
        text "This is a test." slow_cps True
        
    timer 2.0 action Hide("text_test")
There are two key points here. The first is the slow_cps property. That controls text speed, and by setting it to True, it tells Ren'Py to make the speed of that text the user-selected speed.

The second thing is that this is a separate screen from preferences. This is because the number of characters displayed in a text box displayed inside a screen is controlled by the time since the screen the text is in was last shown. Showing the screen starts that counter from 0, allowing the text to slowly display. (If the text was part of preferences screen, it would never re-display.)

Finally, you want to add a button to preferences to show the text speed. Something like:

Code: Select all

    textbutton "Test Text Speed" action Show("text_test")
And that's it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users