How to use a transform only for certain speakers?

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
User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

How to use a transform only for certain speakers?

#1 Post by oatnoodles »

Hello! I have a transform on my dialogue box, but I'd like to set it to not have that transform for centered text. Right now centered text displays at the bottom (since the transform applies to it.)

Here is my say screen:

Code: Select all

screen say(who, what):
  style_prefix "say"

  frame id "window" at WindowEaseBottom:
    if who == None:
      text what id "what"
    else:
      label who id "who"
      text what id "what"
Here is my transform:

Code: Select all

transform WindowEaseBottom:
        on show:
            alpha 0.0
            parallel:
                linear 0.5 alpha 1.0
            parallel:
                xalign 0.5 yalign 1.0
                linear 0.5 yoffset -10
        on hide:
            alpha 1.0
            parallel:
                xalign 0.5 yalign 1.0
                linear 0.5 yalign 1.0 yoffset -30
            parallel:
                linear 0.5 alpha 0.0
Ren'py amateur looking to learn as much as possible! Please be patient with me.

User avatar
thelastsecret
Regular
Posts: 117
Joined: Tue Mar 01, 2022 1:32 pm
Completed: The Last Secret
Projects: Sweet Science – The Girls from Silversee Castle
itch: thelastsecret
Discord: TheLastSecret #5266
Contact:

Re: How to use a transform only for certain speakers?

#2 Post by thelastsecret »

Why not adding an if before frame id "window" at WindowEaseButtom? Then you can have one condition where the at-part is omitted.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]