Shudder - Kinetic Text

This commit is contained in:
LoafyLemon 2024-05-27 16:33:13 +01:00
parent d293b0c973
commit 2680593bf6

View File

@ -71,6 +71,12 @@ init python:
d2 = Transform(Fixed(love_heart((15, 0), 12, 1), love_heart((20, -10), 6, 0.1), love_heart((10, 10), 6, 0.5), fit_first=True), xzoom=-1)
return [(renpy.TEXT_DISPLAYABLE, d), (renpy.TEXT_TAG, "color=#ff69b4"), (renpy.TEXT_TEXT, text), (renpy.TEXT_TAG, "/color"), (renpy.TEXT_DISPLAYABLE, d2)]
@renpy.pure
def text_tag_shudder(tag, argument, contents):
text = contents[0][1]
d = At(Text(text, style="what", color=argument, xsize=32), shudder_text)
return [(renpy.TEXT_DISPLAYABLE, d)]
def random_timer(t, pause, rotation):
return t(renpy.random.uniform(*pause), renpy.random.uniform(*rotation))
@ -131,6 +137,18 @@ transform shake_text:
pos (240, -2) # Workaround; Xpos seems to not account for text box offset and text outline?
function text_shake_func
transform shudder_text:
animation
subpixel True
pos (240, -2) # Workaround; Xpos seems to not account for text box offset and text outline?
easeout 0.1 xoffset -3
easeout 0.1 xoffset 3
easeout 0.1 xoffset -3
easeout 0.1 xoffset 3
easeout 0.1 xoffset 0
pause 0.5
repeat
transform love_heart(pos, size, pause):
animation
subpixel True
@ -146,6 +164,7 @@ define config.custom_text_tags = {
"bounce": text_tag_bounce,
"love": text_tag_love,
"shake": text_tag_shake,
"shudder": text_tag_shudder,
"pulse": text_tag_pulse,
}