Transition between layeredimage states.

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
lordpidey
Newbie
Posts: 6
Joined: Sat Apr 21, 2018 10:48 pm
Contact:

Transition between layeredimage states.

#1 Post by lordpidey »

Hello,

I have a quick question.

How do I apply a transition between two states within a layeredimage?

Look at the following code. It works and shows the animation I want.

Code: Select all

image sarah = "images/sarah.png"
image sarah hat = "images/sarah_with_hat_on.png"

show sarah

s "Okay, just let me grab my hat first.

show sarah hat
with Dissolve(2)

s "I'm ready."

However, this code means I can't use layeredimages as I want, which will lead to future problems.

I want to do something kinda like the below code tag

Code: Select all

layeredimage sarah
    always:
        "images/sarah_base.png"
    if sarah_wearing_hat:
        "images/sarah_blue_hat.png"
		
		
		
$sarah_hat = false
show sarah

s "Okay, just let me grab my hat first.

$sarah_hat = true
with Dissolve(2)

s "I'm ready."
This doesn't produce the intended effect, and the hat just instantly appears.

What can I do to apply transitions like this?

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Transition between layeredimage states.

#2 Post by trooper6 »

Add this code to the top of your script.rpy file.

Code: Select all

define dis = {"master":dissolve} #Or whatever you want that transition to be
define config.say_attribute_transition = dis
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

lordpidey
Newbie
Posts: 6
Joined: Sat Apr 21, 2018 10:48 pm
Contact:

Re: Transition between layeredimage states.

#3 Post by lordpidey »

Okay, that seems to work, but what do I do if I only want some transitions to be dissolve?

Post Reply

Who is online

Users browsing this forum: Andredron