How to get current text speed?

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
tofuuu
Regular
Posts: 51
Joined: Tue Apr 24, 2018 7:15 pm
Contact:

How to get current text speed?

#1 Post by tofuuu »

Hi, so umm it's me again.

Since we can change text speed through slider, can we get the value of text speed that has changed? Is there any renpy function that return value from a slider? Thank you.

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: How to get current text speed?

#2 Post by Kia »

it's stored in: preferences.text_cps

tofuuu
Regular
Posts: 51
Joined: Tue Apr 24, 2018 7:15 pm
Contact:

Re: How to get current text speed?

#3 Post by tofuuu »

Ah so i still can access it. Thank you Kia for your answer!

tofuuu
Regular
Posts: 51
Joined: Tue Apr 24, 2018 7:15 pm
Contact:

Re: How to get current text speed?

#4 Post by tofuuu »

Btw, in case someone need the code

Code: Select all

    python:
        def get_speed():
            return _preferences.text_cps
    $ current_speed = get_speed()
    label _("Text Speed ([cur_speed)")
it shows the value of your text speed beside the Text Speed text :)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]