Code: Select all
define cside = Character("Clover", image="cside", callback=cside_anim, color = "f0a", what_prefix='"', what_suffix='"')
init -1 python:
def cside_anim(event, interact=True, **kwargs):
if event == "show":
renpy.show("side cside talk", at_list=[left], layer='sides')
renpy.sound.play("audio/blip.mp3")
elif event == "slow_done" or event == "end":
renpy.hide("side cside talk", layer='sides')
renpy.show("side cside hush", at_list=[left], layer='sides') # always shows default closed mouth even if "clover awetalk" was just shown
renpy.sound.stop()
renpy.restart_interaction()
init:
layeredimage clover base:
always "clover base.png"
always "clover_blink"
group mouth:
attribute hush default:
"clover mouth.png"
attribute talk:
"clover_talk"
# added this because I couldn't figure out how to pass attributes to cside_anim
layeredimage clover basetalk:
always "clover base.png"
always "clover_blink"
always "clover_talk"
##layeredimages for 'clover awe' and 'clover awetalk' go here, identical to above just with different images
# what I really want to do here is set the side images equal to the base image with a specific attribute i.e. "clover base hush"
# but that throws an error because its not a defined image
image side cside talk = LayeredImageProxy("clover basetalk", Transform(crop=(15, -100, 420, 360), zoom=1.5))
image side cside hush = LayeredImageProxy("clover base", Transform(crop=(15, -100, 420, 360), zoom=1.5))
image side cside talk awe = LayeredImageProxy("clover awetalk", Transform(crop=(15, -100, 420, 360), zoom=1.5))
image side cside hush awe = LayeredImageProxy("clover awe", Transform(crop=(15, -100, 420, 360), zoom=1.5))
Code: Select all
label start:
show clover base with dissolve
c "I'm talking normally."
c awe "Now I'm surprised."
c base "Back to normal."
show side cside hush at left onlayer sides with dissolve
cside "Here I am on the side."
show side cside hush awe onlayer sides with dissolve
cside "Surprised on the side." # shows awe sprite while talking, but jumps to base sprite when done
c awe "Alright, you get the idea."
return
Also, side images are on a separate layer because they were displaying under the textbox for some reason (I didn't edit the say screen at all so add SideImage() comes after the window statement). And without the at left transform the side image isn't positioned properly.