Different Text speed for each characters and how to retrieve preference("text speed") value ?

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.
Message
Author
Dav
Regular
Posts: 28
Joined: Sun Nov 25, 2018 7:57 am
Projects: Fancy Future
Contact:

Re: Different Text speed for each characters and how to retrieve preference("text speed") value ?

#16 Post by Dav » Fri Mar 05, 2021 3:42 am

Imperf3kt wrote:
Wed Mar 03, 2021 9:04 am
Yes, there's a few things missing from the index, but overall it does have most things.

And since I'm at my PC right now, with Ren'Py open, here's some additional code that may help.

I can explain further what this is intended to do and how it works, but you seem to have some basic understanding or higher of programming, so you should be able to understand it I assume. If not, just say and I'll go over it for you.
Thank you ! and yes i understand the code you gave me, i'm a former hardware programmer now retired, more used to lower level languages but gotta evolve :p
Your lines helped me figure a lot of things about renpy actually, only the tooltip thing is still a mystery, it seems to have no effect, i'll study it more today ^^

Have a nice day !

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Different Text speed for each characters and how to retrieve preference("text speed") value ?

#17 Post by Imperf3kt » Fri Mar 05, 2021 6:01 am

Ah, I forgot to remove the tooltips.
To use a tooltip, you just need to add $tooltip = GetTooltip() to any screen it's used in, and possibly style where it is placed.

The documentation has a simple example you could use.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Different Text speed for each characters and how to retrieve preference("text speed") value ?

#18 Post by zmook » Fri Mar 05, 2021 2:14 pm

The thing to understand is that the tooltip property on a ui element just declares a string; it doesn't *do* anything with it. To actually display the tooltip you have to create a text displayable somewhere and set its value to GetTooltip() like Imperf3kt says.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Different Text speed for each characters and how to retrieve preference("text speed") value ?

#19 Post by Imperf3kt » Sat Mar 06, 2021 3:37 am

zmook wrote:
Wed Mar 03, 2021 11:59 am
Imperf3kt wrote:
Wed Mar 03, 2021 9:04 am

Code: Select all

    python:
        txtspd = _preferences.text_cps
        afmtm = _preferences.afm_time
Just to add for the record, `preferences` and `_preferences` are aliases to the same object. By python idiom, the one with the underscore prefix is meant to be treated as private, so if you aren't PyTom it's preferred to use plain `preferences`. (In theory future Ren'Py could add getter or setter functions or something that would make them not identical.)
Thank you for this. I have made the necessary changes, (remove the _)
I'm not even sure where I pulled that variable from in the first place since it's not mentioned anywhere in the documentation and only one or two places on the internet, I think I took it from some common file.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Post Reply

Who is online

Users browsing this forum: Alex, Google [Bot], nyeowmi