[SOLVED] Showing repeat Text() with CPS again?

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
017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

[SOLVED] Showing repeat Text() with CPS again?

#1 Post by 017Bluefield »

So I don't know if this has been addressed already, but I can't seem to find anything on this.

I'm trying to use the same Text() displayables over and over, which includes their cps. The problem is, while it works the first time it's shown, after it's hidden and shown again, it displays the Text() without the cps playing again. Am I missing something obvious?

Code: Select all

    image exceed_drive = Text("Exceed Drive:", color="#F669", size=27, bold=False, text_align=0.5, slow_cps=24)
    image exceed_drive howling_shot = Text("Howling Shot", color="#F33C", size=27, bold=True, text_align=0.5, slow_cps=60)

Code: Select all

    show exceed_drive at truecenter
    pause 2.0
    show exceed_drive howling_shot
    pause 1.8
    hide exceed_drive with dissolve
    
    ...
    
    show exceed_drive at truecenter
    pause 2.0
    show exceed_drive howling_shot
    pause 1.8
    hide exceed_drive with dissolve
Last edited by 017Bluefield on Mon Jul 16, 2018 8:45 am, edited 1 time in total.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Showing repeat Text() with CPS again?

#2 Post by Remix »

Though it takes a little more typing, you can get around it by having the text as a function return:

Code: Select all

init python:

    def exceed_drive():
        return Text("Exceed Drive", color="#F669", size=27, bold=False, text_align=0.5, slow_cps=24)

    def howling_shot():
        return Text("Howling Shot", color="#F33C", size=27, bold=True, text_align=0.5, slow_cps=60)

label start:

    show expression exceed_drive() as ed at truecenter
    pause 2.0
    hide ed with dissolve
    show expression howling_shot() as hs at truecenter
    pause 1.8
    hide hs with dissolve
    
    "..."

    show expression exceed_drive() as ed at truecenter
    pause 2.0
    hide ed with dissolve
    show expression howling_shot() as hs at truecenter
    pause 1.8
    hide hs with dissolve
Frameworks & Scriptlets:

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: Showing repeat Text() with CPS again?

#3 Post by MaydohMaydoh »

Alternatively, the on show seems to get it working.

Code: Select all

image exceed_drive:
    truecenter
    on show:
        Text("Exceed Drive:", color="#F669", size=27, bold=False, text_align=0.5, slow_cps=24)
image howling_shot:
    truecenter
    on show:
        Text("Howling Shot", color="#F33C", size=27, bold=True, text_align=0.5, slow_cps=60)
    
label start:
    show exceed_drive
    pause 2.0
    hide exceed_drive
    show howling_shot
    pause 1.8
    hide howling_shot with dissolve
    
    show exceed_drive
    pause 2.0
    hide exceed_drive
    show howling_shot
    pause 1.8
    hide howling_shot with dissolve
You can also define the position in the image so you don't have to type it every time.

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: Showing repeat Text() with CPS again?

#4 Post by 017Bluefield »

That did the trick! Thanks, you guys! :D

Post Reply

Who is online

Users browsing this forum: Google [Bot]