Which unfortunately is a bit obsolete due to the changes to the screen.rpy over the course of multiple updates, but I was trying to update the solution to work with the current ren'py engine. The example is for a shaking textbox, but I think it can be generalized to any user defined animations, which would let you do a lot of nifty stuff with the textbox.
I thought about using the on statement, but unfortunately that makes it so the ALL the say screens will use this effect, rather that having one particular line cause the animation.
Code: Select all
transform textshake:
on show:
Shake(None, 1.0, dist=5)
Code: Select all
screen say(who, what):
style_prefix "say"
window:
id "window"
if who is not None:
window:
style "namebox"
text who id "who"
text what id "what"
at textshake
I feel like the below should still work since the show_arguments passes whatever you put after 'show_' as an argument to the say screen.
Code: Select all
define e = Character('Eileen', color="#c8ffc8")
define e_shake = Character('Eileen', kind=e, show_window_transform=Shake(None, 1.0, dist=5))
So maybe adding an additional argument to the new say screen?
Code: Select all
screen say(who, what, effect):
style_prefix "say"
window:
...
make use of effect somewhere here?
There is one other way I could think of, which is define a custom screen for every type of animation, but I feel like there should be a way to generalize it so you can just pass an argument instead of having to define 5 different screens
Code: Select all
screen shakescreen(who, what):
window id "window":
vbox at 'user_defined_transform':
spacing 10
...etc