What is the best way to write the code for a scene where one character portrait is shown at a time, on the right side, and when the speaker changes, the portrait changes? Most of the documentation and search results I've seen seems to be for replacing images for one character at a time, or having multiple characters on the screen at once.
At first, I ended up with the character portraits stacking on top of each other on the right side, until I figured out how to write this:
Code: Select all
define a = Character("Aria")
define gp = Character("Grandpa")
define f = Character("Fish")
image GP = "GP.png"
image Aria = "Aria.png"
image Fish = "Fish.png"
label start
scene bg sea
show GP at right
gp "Ah, look at this!"
hide GP
show Aria at right
a "(Happy) What a beautiful fish! <3 "
hide Aria
show GP at right
gp "I hope he tastes as good as he looks."
hide GP
show Fish at right
f "Wait! Don't eat me!"
hide Fish
show Aria at right
a "(Surprised) It talks!"
return