Another approach is to set a default transform that passes an image name into a Python function and uses that to adjust the darkness...
Code: Select all
image eileen = Solid("#F00", xysize=(200, 400))
image lucy = Solid("#F4F", xysize=(200, 400))
image lucy happy = Solid("#4FF", xysize=(200, 400))
define e = Character("Eileen", image="eileen")
define l = Character("Lucy", image="lucy")
transform pop_char(tag=None):
function renpy.curry(pop_character)(tag=tag)
init python:
def pop_character(trans, st, at, tag=None):
trans.mesh = True
adjust = 0.005 if tag == renpy.get_say_image_tag() else -0.005
### Tweak as wanted below...
trans.zoom = min(1.1, max(1.0, trans.zoom + adjust))
try:
value = trans.matrixcolor.value
except:
value = 0.0
trans.matrixcolor = BrightnessMatrix(
min(0.0, max(-0.5, value + adjust * 5.0)))
return 0.0
config.tag_transform["eileen"] = pop_char("eileen")
config.tag_transform["lucy"] = pop_char("lucy")
label start:
# Images shown with at clauses will NOT use the tag_transform
# show eileen at left
# Images shown with colon then transform name(s) will also use the tag transform
show eileen:
left
show lucy:
right
pause
e "Me"
l "No, me"
e "Me, me, me"
l happy "Umm... Me -- Now happy blue"
"Neither"
return
This:
1) Allows the transform to be added without coding it to each line (though existing transforms using at will need tweaks)
2) Allows animation between the states
3) Allows use on multi texture images like Composites or Live2D due to the mesh True setting
4) Does not require defining any new images (as it just uses get_say_image_tag)
This example also pops the character when speaking... Shouldn't be hard to find and remove that bit if unwanted.