Character Callback not activating
Posted: Wed Oct 06, 2021 9:44 pm
Hi there im trying to use a Character callback so that everytime a character speaks the the sprite zooms in a little. I've got the setup with the transforms and the callback in the character definition but nothing happens when the character speaks no zoom. Not getting any errors its as if i never coded a callback here is my basic setup:
Transforms.rpy
Script.rpy
Transforms.rpy
Code: Select all
transform close:
zoom 1.2
transform normal:
zoom 1.0Code: Select all
init python:
def my_zoom1(event, interact=True, **kwargs):
if not interact:
return
if event == "begin":
if renpy.showing("m"):
renpy.show("m", at_list=[close])
elif event == "end":
if renpy.showing("m"):
renpy.show("m", at_list=[normal])
def my_zoom2(event, interact=True, **kwargs):
if not interact:
return
if event == "begin":
if renpy.showing("r"):
renpy.show("r", at_list=[close])
elif event == "end":
if renpy.showing("r"):
renpy.show("r", at_list=[normal])
def my_zoom3(event, interact=True, **kwargs):
if not interact:
return
if event == "begin":
if renpy.showing("ma"):
renpy.show("ma", at_list=[close])
elif event == "end":
if renpy.showing("ma"):
renpy.show("ma", at_list=[normal])
define m = Character('Mother', ctc="ctc_blink", ctc_position="nestled", what_prefix='"', what_suffix='"', callback=my_zoom1)
define r = Character('Robert', ctc="ctc_blink", ctc_position="nestled", what_prefix='"', what_suffix='"', callback=my_zoom2)
define ma = Character('Maya', ctc="ctc_blink", ctc_position="nestled", what_prefix='"', what_suffix='"', callback=my_zoom3)
show Maya1 with dissolve
m "That's all you're getting. You should have thought twice before eating so quickly!"